Skip to content

test: Improve node integration test running #10673

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 15, 2024

Conversation

mydea
Copy link
Member

@mydea mydea commented Feb 15, 2024

This improves the output and formatting of the node integration tests, making it a bit easier to work with them:

  1. Removed the coverage output, making the general output much clearer
  2. Ensure we have color in the jest output, making it easier to scan it
  3. Remove logging around started tests & workers, streamlining the output and aligning it more with the usual jest output.
  4. Move skipped output to the end of the test, clearing up the output for actually run tests
  5. Update summary at the bottom to show success/failed/skipped test numbers
  6. Add color to summary output (error/success/skipped) to make it clearer.
  7. Show relative path names instead of full path names

Skipped tests:
Screenshot 2024-02-15 at 12 04 29

Failed test:
Screenshot 2024-02-15 at 11 46 42

Successful test:

Screenshot 2024-02-15 at 11 48 28

Failed test summary:
Screenshot 2024-02-15 at 11 52 19

Successful test summary:
Screenshot 2024-02-15 at 11 55 28

@mydea mydea requested review from lforst and Lms24 February 15, 2024 11:10
@mydea mydea self-assigned this Feb 15, 2024
@@ -10,7 +10,6 @@ setTimeout(() => {
Sentry.init({
dsn: 'https://[email protected]/1337',
release: '1.0',
debug: true,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also removed a bunch of debug: true leftovers in the tests, to clean up the output.

Copy link
Member

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much better - thanks a lot for tackling this!

One Q: Did anything change in regards to filtering to run a specific test (or subset of tests)? I guess the skipped tests will only be shown in the summary at the end?

const nonSkippedCount = totalCount - skipCount;

if (skips.length) {
console.log('\x1b[2m%s\x1b[0m', '\nSkipped tests:');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

theoretically, we could use chalk or similar libraries for the color bytes but I think this is also fine

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, I thought about this as well - I think it is OK for now, if we want to do more with that we can always switch over to chalk!

@mydea
Copy link
Member Author

mydea commented Feb 15, 2024

Much better - thanks a lot for tackling this!

One Q: Did anything change in regards to filtering to run a specific test (or subset of tests)? I guess the skipped tests will only be shown in the summary at the end?

So if a single test in a suite is skipped, it will be shown normally by jest. Only if all tests in a file are skipped will we show it at the end of the tests in the summary!

@mydea
Copy link
Member Author

mydea commented Feb 15, 2024

For reference, here you can see how it looks (with all successful tests): https://github.com/getsentry/sentry-javascript/actions/runs/7915325070/job/21606990771?pr=10673

@mydea mydea merged commit 8af205e into develop Feb 15, 2024
@mydea mydea deleted the fn/improve-node-integration-tests branch February 15, 2024 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants