-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
test(node): New Node integration test runner #10117
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
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
41a6b67
test(node): New ee2e test runner
timfish abb74bf
Fix lint
timfish f15e1ad
Allow ignoring of specific envelope item types
timfish 4da924f
Move `loggingTransport` to `@sentry-internal/node-integration-tests`
timfish 005c65b
Allow building of types
timfish 24a0b20
Longer tests
timfish fd992b4
fix lint
timfish 111a7c2
Build utils before testing
timfish 48587cd
Ensure e2e utils are cached on build
timfish 120cc5b
support server in scenario and making requests to it
timfish af66eb4
Merge remote-tracking branch 'upstream/develop' into test/e2e-runner
timfish aec3278
remove the timeout overrides and add some more comments
timfish 171abfb
swap test
timfish cfb7e0d
Push dummy test
timfish ff1f88a
dummy test
timfish 97391ae
Reduce Anr hangs
timfish 24309be
Merge branch 'develop' into test/e2e-runner
timfish 9ac27d6
Let the runner optionally do the assertions
timfish 937c117
Merge remote-tracking branch 'origin/test/e2e-runner' into test/e2e-r…
timfish 96d6db1
Merge branch 'develop' into test/e2e-runner
timfish bf29936
Merge branch 'develop' into test/e2e-runner
timfish ede8ad8
Fix lint
timfish 800f886
Merge branch 'develop' into test/e2e-runner
timfish eb32d5d
Merge branch 'develop' into test/e2e-runner
timfish d2834a2
Merge remote-tracking branch 'origin/test/e2e-runner' into test/e2e-r…
timfish c36d147
Merge remote-tracking branch 'upstream/develop' into test/e2e-runner
timfish 214cb8e
Merge branch 'develop' into test/e2e-runner
timfish File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| import { makeBaseNPMConfig, makeNPMConfigVariants } from '@sentry-internal/rollup-utils'; | ||
|
|
||
| export default makeNPMConfigVariants(makeBaseNPMConfig()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| import type { AddressInfo } from 'net'; | ||
| import type { BaseTransportOptions, Envelope, Transport, TransportMakeRequestResponse } from '@sentry/types'; | ||
| import type { Express } from 'express'; | ||
|
|
||
| /** | ||
| * Debug logging transport | ||
| */ | ||
| export function loggingTransport(_options: BaseTransportOptions): Transport { | ||
| return { | ||
| send(request: Envelope): Promise<void | TransportMakeRequestResponse> { | ||
| // eslint-disable-next-line no-console | ||
| console.log(JSON.stringify(request)); | ||
| return Promise.resolve({ statusCode: 200 }); | ||
| }, | ||
| flush(): PromiseLike<boolean> { | ||
| return Promise.resolve(true); | ||
| }, | ||
| }; | ||
| } | ||
|
|
||
| /** | ||
| * Starts an express server and sends the port to the runner | ||
| */ | ||
| export function startExpressServerAndSendPortToRunner(app: Express): void { | ||
| const server = app.listen(0, () => { | ||
| const address = server.address() as AddressInfo; | ||
|
|
||
| // eslint-disable-next-line no-console | ||
| console.log(`{"port":${address.port}}`); | ||
| }); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,11 +11,11 @@ Sentry.init({ | |
| dsn: 'https://[email protected]/1337', | ||
| release: '1.0', | ||
| debug: true, | ||
| integrations: [new Sentry.Integrations.Anr({ captureStackTrace: true, anrThreshold: 200 })], | ||
| integrations: [new Sentry.Integrations.Anr({ captureStackTrace: true, anrThreshold: 100 })], | ||
| }); | ||
|
|
||
| function longWork() { | ||
| for (let i = 0; i < 100; i++) { | ||
| for (let i = 0; i < 20; i++) { | ||
| const salt = crypto.randomBytes(128).toString('base64'); | ||
| // eslint-disable-next-line no-unused-vars | ||
| const hash = crypto.pbkdf2Sync('myPassword', salt, 10000, 512, 'sha512'); | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this simply because it allows you to call
yarn jest -t "name-of-test" --verboseand get debug output very quickly from a single test.yarn test -t "name-of-test"runs through the existing custom test runner code and takes ages...Hopefully we can migrate to just using the jest runner!