Skip to content

test(replay): Test against CDN bundles in Playwright integration tests #6770

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 10 commits into from
Jan 17, 2023

Conversation

Lms24
Copy link
Member

@Lms24 Lms24 commented Jan 13, 2023

Thanks to #6666 we now can inject integration CDN bundles into our Playwright tests. This PR builds on top of #6666 and #6735 to inject the Replay CDN bundle into our integration tests and test against them.

We still can't get rid of the skip condition at the beginning of Replay tests, as we don't have es5 bundles for replay but I think that's fine for the time being.

Furthermore, for this to work properly, Replay has to be imported from @sentry/replay. As a result, tests that run against Replay bundles technically don't check that it is continued to be exported via @sentry/browser. Hence, I copied the basic captureReplay test and left it once untouched, so we still cover importing Replay via @sentry/browser.

In order to test against the minified CDN bundles (which is most important IMO), I had to exclude the _replay variable from being mangled from terser in our bundles, as we're trying to access window.Replay._replay from the test. I'm fine with this change as long as it doesn't significantly blow up our bundle size but happy to look at better suggestions if necessary.

closes #6613

@Lms24 Lms24 requested review from mydea and onurtemizkan January 13, 2023 15:11
@github-actions
Copy link
Contributor

github-actions bot commented Jan 13, 2023

size-limit report 📦

Path Size
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 19.82 KB (+0.03% 🔺)
@sentry/browser - ES5 CDN Bundle (minified) 61.47 KB (+0.06% 🔺)
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 18.5 KB (+0.04% 🔺)
@sentry/browser - ES6 CDN Bundle (minified) 54.77 KB (+0.06% 🔺)
@sentry/browser - Webpack (gzipped + minified) 20.22 KB (0%)
@sentry/browser - Webpack (minified) 66.17 KB (0%)
@sentry/react - Webpack (gzipped + minified) 20.24 KB (0%)
@sentry/nextjs Client - Webpack (gzipped + minified) 47.51 KB (0%)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 26.73 KB (+0.04% 🔺)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 25.02 KB (+0.03% 🔺)
@sentry/replay ES6 CDN Bundle (gzipped + minified) 43.12 KB (-0.81% 🔽)
@sentry/replay - Webpack (gzipped + minified) 38.45 KB (-0.99% 🔽)

Copy link
Collaborator

@onurtemizkan onurtemizkan left a comment

Choose a reason for hiding this comment

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

One suggestion, overall looks good to me! 🚀

Copy link
Member

@mydea mydea left a comment

Choose a reason for hiding this comment

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

Nice! Looking good, and ever improving coverage 🎉

@Lms24 Lms24 force-pushed the lms-replay-playwright-bundles branch 2 times, most recently from 98c7072 to eac2c75 Compare January 16, 2023 12:03
@Lms24 Lms24 force-pushed the lms-replay-playwright-bundles branch from eac2c75 to c010750 Compare January 16, 2023 13:47
@mydea
Copy link
Member

mydea commented Jan 16, 2023

Note: Depending on what we merge first, this or #6793, we should also add one integration test checking the browser+tracing+replay bundle!

@Lms24 Lms24 merged commit 6227e44 into master Jan 17, 2023
@Lms24 Lms24 deleted the lms-replay-playwright-bundles branch January 17, 2023 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Test against Replay CDN bundles
3 participants