Skip to content

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

Merged
merged 8 commits into from
May 31, 2024
Merged

Conversation

mydea
Copy link
Member

@mydea mydea commented May 29, 2024

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.

@mydea mydea self-assigned this May 29, 2024
@@ -9,7 +9,7 @@ Sentry.init({
tracesSampleRate: 1.0,
integrations: [Sentry.browserTracingIntegration({})],
tunnel: `http://localhost:3031/`, // proxy server
debug: true,
debug: !!process.env.DEBUG,
Copy link
Member Author

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.

Copy link
Member

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 😅

Copy link
Member

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)

Copy link
Member Author

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

Copy link
Member Author

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

@mydea mydea changed the title ref: Refactor utils into @sentry-internal/test-utils test: Refactor utils into @sentry-internal/test-utils May 29, 2024
{
name: 'chromium',
use: {
// This comes from `devices["Desktop Chrome"]
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 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.

Copy link
Contributor

@lforst lforst left a 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}`,
Copy link
Contributor

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.

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, agreed, I guess if it is abstracted away this way it is less of a problem at least!

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.

Nice refactor!

(Just once comment about Angular but LGTM otherwise)

Copy link
Contributor

github-actions bot commented May 29, 2024

size-limit report 📦

Path Size
@sentry/browser 21.74 KB (0%)
@sentry/browser (incl. Tracing) 32.76 KB (+0.1% 🔺)
@sentry/browser (incl. Tracing, Replay) 68.33 KB (+0.05% 🔺)
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 61.64 KB (+0.05% 🔺)
@sentry/browser (incl. Tracing, Replay with Canvas) 72.39 KB (+0.05% 🔺)
@sentry/browser (incl. Tracing, Replay, Feedback) 84.5 KB (+0.04% 🔺)
@sentry/browser (incl. Tracing, Replay, Feedback, metrics) 86.35 KB (+0.04% 🔺)
@sentry/browser (incl. metrics) 25.92 KB (+0.02% 🔺)
@sentry/browser (incl. Feedback) 37.9 KB (0%)
@sentry/browser (incl. sendFeedback) 26.32 KB (0%)
@sentry/browser (incl. FeedbackAsync) 30.86 KB (0%)
@sentry/react 24.51 KB (0%)
@sentry/react (incl. Tracing) 35.8 KB (+0.07% 🔺)
@sentry/vue 25.73 KB (+0.02% 🔺)
@sentry/vue (incl. Tracing) 34.59 KB (+0.08% 🔺)
@sentry/svelte 21.87 KB (0%)
CDN Bundle 23.11 KB (0%)
CDN Bundle (incl. Tracing) 34.5 KB (+0.12% 🔺)
CDN Bundle (incl. Tracing, Replay) 68.42 KB (+0.05% 🔺)
CDN Bundle (incl. Tracing, Replay, Feedback) 73.6 KB (+0.05% 🔺)
CDN Bundle - uncompressed 68 KB (0%)
CDN Bundle (incl. Tracing) - uncompressed 102.16 KB (+0.06% 🔺)
CDN Bundle (incl. Tracing, Replay) - uncompressed 212.05 KB (+0.03% 🔺)
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 224.52 KB (+0.03% 🔺)
@sentry/nextjs (client) 35.14 KB (+0.06% 🔺)
@sentry/sveltekit (client) 33.39 KB (+0.08% 🔺)
@sentry/node 115.24 KB (0%)
@sentry/aws-serverless 103.72 KB (0%)

@mydea mydea merged commit b1708d0 into develop May 31, 2024
108 checks passed
@mydea mydea deleted the fn/e2e-utils branch May 31, 2024 10:22
c298lee pushed a commit that referenced this pull request Jun 4, 2024
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.
c298lee pushed a commit that referenced this pull request Jun 11, 2024
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.
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.

4 participants