Skip to content

Conversation

@onurtemizkan
Copy link
Collaborator

Part of: #4333

@github-actions
Copy link
Contributor

github-actions bot commented Dec 21, 2021

size-limit report

Path Base Size (01161b0) Current Size Change
@sentry/browser - CDN Bundle (gzipped) 19.72 KB 19.72 KB +0.02% 🔺
@sentry/browser - CDN Bundle (minified) 62.76 KB 62.77 KB +0.01% 🔺
@sentry/browser - Webpack 22.25 KB 22.25 KB 0%
@sentry/browser - Webpack - gzip = false 75.92 KB 75.92 KB 0%
@sentry/react - Webpack 22.29 KB 22.29 KB 0%
@sentry/nextjs Client - Webpack 46.41 KB 46.41 KB 0%
@sentry/browser + @sentry/tracing - CDN Bundle (gzipped) 28.37 KB 28.38 KB +0.02% 🔺

@onurtemizkan onurtemizkan changed the title Add integration tests for withScope test(browser): Add integration tests for withScope Dec 21, 2021
Sentry.init({
dsn: 'https://[email protected]/1337',
beforeSend: event => {
window.events.push(event);
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need this beforeSend?

Copy link
Collaborator Author

@onurtemizkan onurtemizkan Dec 21, 2021

Choose a reason for hiding this comment

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

When testing with multiple events, we need to back up copies, as we may be testing them after they're sent and deleted.
This approach is used in the old integration tests , but alternatively I have implemented a helper function there to keep track of multiple requests. It was intended for more complex cases, but we may switch to that everywhere.

And that function is out of scope of that PR :/ I'll move it out. 👍

@@ -0,0 +1,11 @@
import * as Sentry from '@sentry/browser';

window.Sentry = Sentry;
Copy link
Member

Choose a reason for hiding this comment

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

The SDK should be setting Sentry on the window automatically - we don’t have to manually do this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Weird, it's not set on the test browser. Maybe Playwright blocks auto assignments to window, I'll dig deeper on it.

Copy link
Member

Choose a reason for hiding this comment

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

Imo we can just leave it for now to get these tests in!

Something we can come back to.

@smeubank smeubank added this to the Release Stability milestone Dec 21, 2021
@onurtemizkan
Copy link
Collaborator Author

@AbhiPrasad, getMultipleSentryRequests weirdly flakes on Firefox. I'm debugging it now. Let's not merge the other PRs for now.

@AbhiPrasad
Copy link
Member

Ah I didn’t see this till after I merged in the PRs @onurtemizkan - that’s my bad.

@onurtemizkan
Copy link
Collaborator Author

No worries at all, @AbhiPrasad, I have sent a patch that seems to resolve that (#4360), not sure how though.

@AbhiPrasad AbhiPrasad enabled auto-merge (squash) December 22, 2021 22:51
@AbhiPrasad AbhiPrasad merged commit 74d2755 into master Dec 22, 2021
@AbhiPrasad AbhiPrasad deleted the onur/public-api-tests-with-scope branch December 22, 2021 23:02
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