test: add headless e2e test that runs the Jasmine frontend suite - #45
Merged
Conversation
Drive frontend/test/SpecRunner.html in headless Chrome (chromedp) and fail if any spec fails, automating the verdict that was previously only eyeballed via cmd/testserver. A small custom reporter publishes the result on window.__jasmineResults since Jasmine's jsApiReporter is deprecated and unwired. Lives in e2e/jasmine so it is gated behind the e2e task and excluded from unit tests; add a test-frontend-headless mise task. Also fix a stale utils spec that still expected 5 function tabs after a sixth (data) tab was added.
The E2E job failed because headless Chrome crashed on startup: the new Jasmine test reported "websocket url timeout reached" (Chrome never printed its DevTools endpoint) and the first godog scenario hit a cold context deadline. CI containers expose a ~64MB /dev/shm, which headless Chrome exhausts; routing shared memory to /tmp via --disable-dev-shm-usage keeps the browser stable. Add the flag to both the godog allocator and the Jasmine test's allocator.
The real cause of the E2E job failure: `go test ./e2e/...` builds two
Chrome-driving binaries (./e2e godog and ./e2e/jasmine) and Go runs
different packages' binaries in parallel by default. Their two headless
Chromes contend for the runner, so the Jasmine Chrome can't start within
chromedp's 20s window ("websocket url timeout reached") and the godog
cold-start scenario blows its deadline. -p 1 serializes the binaries, the
way the godog suite already runs its own scenarios with Concurrency: 1.
(The earlier --disable-dev-shm-usage flag is kept as CI hardening.)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds an e2e test (
e2e/jasmine) that drivesfrontend/test/SpecRunner.htmlin headless Chrome and fails if any Jasmine spec fails, automating the verdict that was previously only eyeballed viacmd/testserver. A small custom reporter inSpecRunner.htmlpublishes the result onwindow.__jasmineResults, since Jasmine's built-injsApiReporteris deprecated and not wired up. The test lives undere2e/so it is gated behind the e2e task and excluded from unit tests, with a dedicatedtest-frontend-headlessmise task. It also fixes a staleutils.spec.jsthat still expected 5 function tabs after a sixth (data) tab was added. Verified: 472 specs, 0 failures.