Repository navigation
ci(site): run the explorer's browser tests - #35
Conversation
|
This security review couldn’t start because the paying account has exhausted its Codex allowance and has insufficient available credits. The payer can check their balance and add credits in the Codex usage dashboard, then try again. If you do not manage the paying account, contact this repository's admins. |
…plorer A dev dependency only, at an exact version, and not part of the published package. The browser itself is not an npm dependency: Playwright downloads it on request, which CI does through a cache keyed on this version.
The checks that were run by hand against the built site are now Playwright tests in e2e/, in TypeScript under the repository's lint rules, with assertions in place of logging. The harness builds the site and serves it with vite preview itself and stops it afterwards, on a fixed port that fails if something already holds it. Retries are off, since a test that passes only on a retry is a flake to fix. The tests cover the operations and cancelling a count that never finishes, the form and the JSON view as one model, every kind of node the schema defines, share links, gists, saved models, import and export, the operation descriptions, keyboard-only editing, phone width and the colour schemes. The unit run excludes e2e/, so `pnpm test` stays browserless, and `pnpm typecheck` covers the new project.
The job decides for itself whether the site, the library source, the tests or the dependencies changed, by diffing against the pull request's base or the commit a push replaces, and runs the rest of its steps only when they did. A workflow-level path filter would leave a required check missing on a pull request that touches none of those paths; this job reports passing at once instead, so Required Checks can depend on it. A base that cannot be fetched runs the tests. The browser binary is cached on Playwright's version, platform and architecture, only the headless shell is installed, and the operating system libraries are installed when the runner allows it. Traces of a failed run are kept for a week.
…t be set On the self-hosted runner the preview server ran and the tests could not reach it: the server listened on `localhost`, which resolved to the IPv6 loopback alone, while the tests ask for the IPv4 one. The server now listens on 127.0.0.1, the address the tests use. The port can be set with E2E_PORT for a machine where another process already holds the default, and a port something holds still fails the run, since the server is started with --strictPort.
28db795 to
798ae87
Compare
|
@codex security review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
This security review couldn’t start because the paying account has exhausted its Codex allowance and has insufficient available credits. The payer can check their balance and add credits in the Codex usage dashboard, then try again. If you do not manage the paying account, contact this repository's admins. |
|
🎉 This PR is included in version 2.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Fixes #29.
The explorer's browser checks are now Playwright tests in
e2e/and run in CI as one job,Browser. The suite is the three scripts from the build sessions turned into TypeScript under the repo's lint rules with real assertions: operations and cancelling a count that never finishes, the form and the JSON view as one model, every kind of node in trilean's schema, share links, gists, saved models, import and export, the operation descriptions, keyboard-only editing, phone width and both colour schemes. The harness builds the site and runsvite previewitself on a fixed port with--strictPort. Retries are off.pnpm testexcludese2e/and stays browserless;pnpm typecheckand ESLint cover the new project. I broke the site five ways (Cancel, rename, a help sentence, the link's index, the retained model) and each failed only the tests that should.The precedent is agent-comms, whose E2E job resolves the Playwright version, caches
~/.cache/ms-playwrightonplaywright-<os>-<version>and installs the browser on a miss. graphle, process-graph, talktrack and wire-mesh install Chromium on every run, uncached. I followed agent-comms and added the architecture to the key.The job decides for itself whether anything it depends on changed (
site/,src/,e2e/, the Playwright config,package.json, the lockfile) by diffing against the PR's base or the commit a push replaces. A workflow-level path filter would leaveRequired Checksmissing on a PR that touches none of those, so instead the job always runs and passes at once when nothing relevant changed.Required Checksdepends on it. The release job does not: the package is unaffected by a site regression. A base that cannot be fetched runs the tests.Cost, in work: one job added (eleven steps; two run when nothing relevant changed, the rest are skipped). Downloads on a cache miss, for Linux x64: 125,797,539 bytes for Chromium's headless shell and 2,302,701 for ffmpeg, 128,100,240 in all (arm64: 127,748,574).
--only-shellavoids the 200,345,244-byte full Chromium. On a hit nothing comes from Playwright's CDN. Before that,pnpm installadds@playwright/test,playwrightandplaywright-core, 18,718,670 bytes unpacked. A run is one site build and one server, 53 tests, no retries.The job ran on the self-hosted fleet (linux/arm64). The operating system libraries were installed with
playwright install-depsthrough the runner's passwordless sudo, which the step uses when it can and otherwise skips with a message. The first run caught a real defect, fixed in the last commit:vite previewlistened onlocalhost, which resolved to the IPv6 loopback only, so the tests could not reach it; the server now listens on127.0.0.1. A rerun of the job restored the browser from the cache and skipped the install step.The path decision for a pull request that touches none of the paths is not exercised by this one, which touches all of them; I ran its pattern over a list of file names and only
site/,src/,e2e/, the Playwright config,package.jsonand the lockfile select the tests.Every commit is scoped
site, whichunreleasedScopeskeeps off npm, and the existing release-rules test already covers every commit type in that scope, so it needed no extension.