-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
test: Refactor utils into @sentry-internal/test-utils
#12277
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
Conversation
@@ -9,7 +9,7 @@ Sentry.init({ | |||
tracesSampleRate: 1.0, | |||
integrations: [Sentry.browserTracingIntegration({})], | |||
tunnel: `http://localhost:3031/`, // proxy server | |||
debug: true, | |||
debug: !!process.env.DEBUG, |
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.
Made this opt-in everywhere to not pollute logs in regular runs.
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.
this might break - I think angular isn't smart enough to reason about process.env
at build time 😬
But we'll see it anyway in CI 😅
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.
IIRC I hard-coded the DSN a couple of lines above for the same reason (should have left a comment)
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.
ah, I see xD well if it break I will remove it :D
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.
it failed locally as well now, so I removed this - and also added a comment for future us :D
@sentry-internal/test-utils
@sentry-internal/test-utils
{ | ||
name: 'chromium', | ||
use: { | ||
// This comes from `devices["Desktop Chrome"] |
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 just inlined this because playwright kept complaining that it was being imported multiple times, and/or there would be version mismatches etc. So now, I simply inlined the values we are using here, which seems simple enough.
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.
nice
/* Run your local dev server before starting the tests */ | ||
webServer: [ | ||
{ | ||
command: `node ${eventProxyFile}`, |
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.
there is probably some way we can make this event-proxy starting thing more convenient, but it's fine to do this as a followup.
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.
yeah, agreed, I guess if it is abstracted away this way it is less of a problem at least!
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.
Nice refactor!
(Just once comment about Angular but LGTM otherwise)
size-limit report 📦
|
Re-use this for playwright config in E2E tests.
Re-use this for playwright config in E2E tests. Now, instead of repeating the whole playwright config, we can import the util from `@sentry-internal/test-utils` and pass it some config. I left the places where do not yet use the proxy, because for simplicity I built the util in a way that assumes the proxy (you can override it, but I figured not worth it for stuff that we will refactor soon anyhow). While at it, I also streamlined the playwright version used everywhere to an up-to-date version.
Re-use this for playwright config in E2E tests. Now, instead of repeating the whole playwright config, we can import the util from `@sentry-internal/test-utils` and pass it some config. I left the places where do not yet use the proxy, because for simplicity I built the util in a way that assumes the proxy (you can override it, but I figured not worth it for stuff that we will refactor soon anyhow). While at it, I also streamlined the playwright version used everywhere to an up-to-date version.
Re-use this for playwright config in E2E tests.
Now, instead of repeating the whole playwright config, we can import the util from
@sentry-internal/test-utils
and pass it some config.I left the places where do not yet use the proxy, because for simplicity I built the util in a way that assumes the proxy (you can override it, but I figured not worth it for stuff that we will refactor soon anyhow).
While at it, I also streamlined the playwright version used everywhere to an up-to-date version.