jawstree: run production regression pages under jsdom#151
Merged
Conversation
Load the dynamic-insert and reconcile regression pages with node and the
jsdom package instead of a headless browser, reading the page's #result
element directly rather than decoding a screenshot pixel. Launching a
real browser is a GUI app launch: on macOS it intermittently aborts at
startup when launchservicesd refuses to issue an ASN ("unable to get
application ASN from launchservicesd"), failing the run and popping a
"Firefox has quit unexpectedly" crash dialog. jsdom runs the same
shipped assets without any GUI process, so that failure mode cannot
occur, and it reports which condition failed instead of a red pixel.
The tests skip when node or jsdom is unavailable, and fail instead when
JAWS_REQUIRE_NODE is set. GitHub runner images ship node and npm but no
npm packages, so the build workflow installs jsdom before testing.
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.
Why
The two jawstree production regression tests launch headless Firefox to render a page and screenshot it. On macOS this intermittently aborts at Firefox startup —
_RegisterApplication(), unable to get application ASN from launchservicesd(SIGABRT inTransformProcessType) — which fails the test run and pops a "Firefox has quit unexpectedly" crash dialog. The failure is environmental (GUI-session registration can be refused for processes launched from sandboxed/unattended contexts), so no browser-based harness avoids it.What
jawstree/jsdom_test.goharness: loads a generated page under jsdom vianode -e(runScripts: "dangerously",resources: "usable",pretendToBeVisualfor the widget'srequestAnimationFrameuse) and passes only when the page turns its#resultelement green. On failure it reports the element state and any jsdom errors instead of an opaque red pixel.node_modules(e.g.npm install jsdomat the repo root) or from the npm global root viaNODE_PATH. Tests skip when node or jsdom is unavailable and fail instead whenJAWS_REQUIRE_NODEis set, matching the existing node-driven test convention.npm install --no-save jsdom) before the test step;.gitignorecovers local npm artifacts. The 386 leg intentionally skips these tests (no jsdom there).Verification
JAWS_REQUIRE_NODE=1they fail loudly.-race; a deliberately never-green page makes the runner exit non-zero with diagnostics.go vet,gofmt -l,staticcheck,golangci-lint,gosec,go build,go test -race ./...all clean.