Skip to content
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

fix(wasm): Check for browser bundle existence before running tests #4074

Merged
merged 1 commit into from
Oct 19, 2021

Conversation

lobsterkatie
Copy link
Member

As of #4048, it's more likely that one might try to run the full test suite without having built the browser bundle. Since the wasm tests rely on it, this adds a check before they run, along with an error message letting the user know why things aren't working.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 18, 2021

size-limit report

Path Size
@sentry/browser - CDN Bundle (gzipped) 22.36 KB (+0.01% 🔺)
@sentry/browser - Webpack 23.24 KB (0%)
@sentry/react - Webpack 23.27 KB (0%)
@sentry/browser + @sentry/tracing - CDN Bundle (gzipped) 29.8 KB (+0.01% 🔺)

Copy link
Contributor

@iker-barriocanal iker-barriocanal left a comment

Choose a reason for hiding this comment

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

This looks good, but it'd be better if we do something to prevent having this error. Having a check for this before running the tests that build the browser CDN bundle is a better choice IMO.

@rhcarvalho
Copy link
Contributor

Having a check for this before running the tests that build the browser CDN bundle is a better choice IMO.

And that should also prevent running the tests accidentally against a stale build, so +1 👍

@lobsterkatie
Copy link
Member Author

lobsterkatie commented Oct 19, 2021

Having a check for this before running the tests that build the browser CDN bundle is a better choice IMO.

And that should also prevent running the tests accidentally against a stale build, so +1 👍

Yeah, I thought about doing that, but (for once!) I didn't want to over-engineer things, and I also wondered at whether there might not be times when you'd want to be the one in control of that rather than a script forcing it on you.

Seeing as these tests have been there the better part of year and we've yet to run into the problem (that I know of), I'm going to merge this now and we can keep the other in mind if this ever crops up again.

If either of you feels strongly about this, happy to revisit it.

@lobsterkatie lobsterkatie merged commit 111ea28 into master Oct 19, 2021
@lobsterkatie lobsterkatie deleted the kmclb-add-error-message-to-wasm-tests branch October 19, 2021 13:16
lobsterkatie added a commit that referenced this pull request Jan 12, 2022
The tests in our `wasm` package use the browser bundle, and therefore won't run if the bundle hasn't been built. #4074 added a warning for this situation. This improves that by actually building the missing bundles, ensuring the tests will always run.
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.

3 participants