feat(ci): Adds playwright tests for sveltekit to bazel#62560
feat(ci): Adds playwright tests for sveltekit to bazel#62560camdencheek merged 106 commits intomainfrom
Conversation
jhchabran
left a comment
There was a problem hiding this comment.
Nice to finally see this going green 🚀
I tried running it locally, but it trips on the browser location.
After digging a bit, it seems that:
sg setupchecks for Chromium being installed, which passes for me (I'm running thesg setupfrom the branch).sg bazel test //client/web-sveltekit:e2e_testfails because it cannot find the browser.
After closer inspection, it's because npx playwright install gets me chromium-1117 ffmpeg-1009 firefox-1449 webkit-2003 but the Bazel targets looks for chromium-1105.
Is that a "de-sync" in between the Bazel side and the local env? Wouldn't it be safer to provide the classic select(...) approach and always install chromium through Bazel?
|
Yay green! I'm excited that we're at this point now :) To give some more input for the browser version mismatch, here's what I've seen. I ran Running with I saw that it downloaded chromium-1117 via @jhchabran when would you run When I run According to the playwright docs, each version of playwright is tied to a certain browser version. Playwright's stance is that you shouldn't influence this and that they won't allow you to make this configurable, but there's an escape hatch via the launch options to specify a binary (we're using that in this PR).
|
@bahrmichael All the time. You get the remote cache set up for free with As for the issues you mentioned, let's see when James come online, and I hope we can come up with a way to fix that, there are other solutions, but it ain't going to be pretty if we have to parse the version and dynamically download it on the fly. |
|
Noticed another thing. After running |
|
(woops accidental "update branch", thought this was another PR of mine) |
|
@jhchabran @bahrmichael The reason we can't just install chromium for Mac is because Bazel cannot handle runfiles with spaces (more details in this merged PR). Noah had some suggestions in this slack thread but I haven't tried them. As for why it's installing the wrong version of playwright it's probably because I used |
Ah right, it's fine then, if
Ack, np! |
…urcegraph into jsm/playwright-playground
…urcegraph into jsm/playwright-playground
|
@jamesmcnamara I updated this PR's description to auto-close my tracking ticket when it's merged. Just FYI. |
I disabled a few tests to get #62560 merged. This just goes back and fixes the ones I disabled. There are still a handful skipped, but the fixes were non-trivial.
Closes https://github.com/sourcegraph/sourcegraph/issues/60881
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 testwith 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:
Test plan
Should be run in CI and go green by the end!