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

feat(ci): Adds playwright tests for sveltekit to bazel #62560

Draft
wants to merge 74 commits into
base: main
Choose a base branch
from

Conversation

jamesmcnamara
Copy link
Contributor

@jamesmcnamara jamesmcnamara commented May 8, 2024

Attempting to run playwright tests out of bazel. This changes how the app is served in the tests, specifically playwright will intercept all network calls to the local server and serve the static assets directly or serve root index.html file if nothing is matched.

Just running pnpm test with this change, about 68% of tests pass (43 out of 67), indicating that about a 1/3 of tests likely have some network dependency.

Enabling this in bazel we get just slightly more tests failing (4 more to be exact), which means there is some difference between the two. For instance, this test fails in bazel but not through PNPM. Adding some printlns I can see that this path is getting hit in bazel but not in pnpm. Would love an extra set of eyes on this.

TODO:

  • Fix tests running locally
  • Fix tests failing only in bazel
  • Fetch browsers properly in bazel

Test plan

Should be run in CI and go green by the end!

jamesmcnamara and others added 30 commits March 6, 2024 10:22
@bahrmichael
Copy link
Contributor

I merged from main to bring in #62820 which should resolve the problems with tests that fail locally.

@jamesmcnamara
Copy link
Contributor Author

@bahrmichael I added some fixes in 83fd4cc but there are still four tests failing in bazel that don't fail when running it directly. As far as I can tell, the issue is coming from somewhere in here.

Unfortunately the error is rather inscrutable. If you run it through the debug UI, you'll see that there is an error when loading one of the entry point javascript files (app.[some-hash-code].js) but the error is simply e. No stack trace, no content, nothing.

If I force the local test runner to use the bazel files it produces the same error. So there's some difference to how the app is compiled for bazel compared to how it is compiled locally.

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.

None yet

2 participants