Skip to content

ci: run the info site tests on changes to sites/meshview-info - #1024

Merged
dborup merged 1 commit into
masterfrom
ci/info-site-tests
Nov 28, 2026
Merged

dborup merged 1 commit into
masterfrom
ci/info-site-tests

Conversation

@dborup

@dborup dborup commented Nov 28, 2026 •

Copy link
Copy Markdown
Owner

Relates to #1014

Why

The standalone info pages in sites/meshview-info/ (/velkommen, /observer, /hardware, /radio, /guider, /faq) have their own Playwright tests, but deploy.yml never runs them. They only ran by hand. Found in the second review of #1014, whose stacked PR also got no checks at all, because deploy.yml only runs for PRs to master.

What

  • .github/workflows/info-site.yml (new), with one job, "🌐 Info site tests".
    • Triggers: pull requests with any base (so stacked info PRs such as feat(info): /guider page with click-to-play video guides #1012 → feat(info): /faq page with answers for the Danish network #1014 get checks too), pushes to master, and workflow_dispatch. Each is limited to changes in sites/meshview-info/**, the runner or the workflow itself.
    • Steps: Node 22 with the npm cache, npm ci, npx playwright install --with-deps chromium, then the runner.
    • Permissions: contents: read only. No secrets, no publish, no deploy, so there is nothing for the fork guards to protect.
    • Concurrency: one run per PR; a newer push cancels the older run.
  • scripts/run-info-site-tests.sh (new) runs every sites/meshview-info/test-*.cjs and test-*.js.
    • A new test file is picked up without editing the workflow.
    • It fails if any test fails, and also if no test is found, so a moved folder cannot pass silently.

Tests

  • Locally on master's tree: test-mobile.cjs, test-xss.cjs and test-copy-commands.js pass, giving "3 info site tests, 0 failed" and exit 0.
  • Failing test: an added test-zz-fail.cjs makes the runner exit 1 and name the file.
  • No tests: an empty folder exits 1 with "no info site tests found".
  • Workflow file: it parses, and the step list was checked.
  • This PR changes the workflow, so the workflow runs on this PR itself. That run is the CI proof.
  • No repo test reads any workflow other than deploy.yml, so nothing else needs updating.

Not included

  • Other workflows are unchanged. deploy.yml still runs its full pipeline on every PR to master, including this one; the new job runs next to it.

🤖 Generated with Claude Code

deploy.yml never ran sites/meshview-info/test-*, so the /velkommen,
/guider and /faq tests only ran by hand (found in the #1014 review).

info-site.yml runs on pull requests (any base, so stacked info PRs get
checks too) and pushes to master that touch sites/meshview-info/, the
runner or the workflow. Read-only: contents read, no secrets, no
publish. scripts/run-info-site-tests.sh runs every test-*.cjs|js there
and fails on any failing test or when none is found.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@adminopenclaw8-sketch

Copy link
Copy Markdown
Collaborator

Review — CS-Macmini PR#1024 — head c50e398

Dom: APPROVE med nits

Independent, read-only review. Head SHA checked with git ls-remote before and after: unchanged. Merged tree built with git merge-tree --write-tree origin/master <full head sha> against master a49526df.

Findings

# Sev Finding Evidence
N1 nit The runner has no automated test. Its fail-on-failure and fail-on-none paths were only checked by hand (PR body). Repo rule 1 asks for a regression test; the "Script & Container Unit Checks" job already hosts scripts/test-*.sh style checks, so a small scripts/test-run-info-site-tests.sh would fit. [A] diff has 2 files, no test
N2 nit Only test-*.cjs and test-*.js are globbed. A new test-foo.mjs is silently skipped, and the "none found" guard does not catch it because the other tests still exist. Mutant M6 below. [T] M6 exit 0
N3 nit The path filter lacks package.json / package-lock.json. A Playwright bump (the only dependency the tests use) will not trigger this workflow. [A] workflow paths:
N4 info A path-filtered workflow cannot be a required status check: when nothing matches, the check never reports. So this job is advisory in branch protection. That is acceptable for the stated goal; just do not mark it required. [K]

No blocking findings.

Answers to the review points

  1. Triggers and path filters [A][T]. pull_request has no branches: filter, so any base runs (stacked info PRs get checks). push is limited to master, plus workflow_dispatch. The three path entries (sites/meshview-info/**, the runner, the workflow) match what the tests read: all three tests only read files under sites/meshview-info/ (__dirname, assets/…, index.html); none reads anything outside it. The workflow ran on this PR (it touches its own file). Only gap: N3.
  2. Security [A]. permissions: contents: read only, no secrets, no pull_request_target, no publish/deploy/login, no GHCR. Action majors actions/checkout@v5 and actions/setup-node@v5 are identical to deploy.yml. deploy.yml is untouched (9 fork-guard occurrences stay at 9; the new file adds none and needs none because it has no side effect). Parsed with Ruby YAML: triggers pull_request, push, workflow_dispatch, permissions {contents: read}. On fork PRs the token is read-only anyway.
  3. Runner [T]. See mutants. Exit code is propagated, a failing, crashing, signal-killed or syntactically broken test fails the run and is named. No tests or a missing folder exits 1. Quoting is safe ("$t", "${failed[@]}", file name with a space works). nullglob is set so an empty glob does not stay literal. -e is deliberately not set so every test runs; failures are collected and exit 1 at the end. Works from any cwd (cd "$(dirname "$0")/…").
  4. Workflow run on this PR [T]. Job "🌐 Info site tests" is green. Log read: checkout, Node 22 with npm cache, npm ci, Playwright chromium install, then test-mobile.cjs (20 PASS lines, 5 widths × 4 pages), test-xss.cjs, test-copy-commands.js, "3 info site tests, 0 failed". The three tests are exactly the three files on master's tree. Whole job about 40 s (13:56:14 to 13:56:52).
  5. Actions usage [A][T]. One job on one runner, timeout-minutes: 15, about 40 s measured, so it is smaller than the stated 2–4 min. Concurrency group info-site-<PR number or ref>, cancel-in-progress only for pull requests (pushes to master are not cancelled).

Tests and mutants

Merged tree (9d33b8ca…, fresh npm ci):

  • bash scripts/run-info-site-tests.sh → 3 tests, 0 failed [T].
  • node test-frontend-helpers.js passes [T].
  • Go suites, sh test-all.sh and the E2E fixture run were not run: the PR changes only a workflow and a shell script, none of which any Go or JS suite reads (git grep finds no reference outside the PR). The CI/CD Pipeline jobs were still pending when I finished (4 pass, 9 pending); I did not wait for them.

Red-before / green-after per acceptance behaviour (issue #1014 follow-up, "info tests run in CI"): the green run above is the proof for "tests run"; the red cases are the mutants:

Mutant Result
M1 extra test-zz fail.cjs (space in name) exiting 3 exit 1, FAIL: test-zz fail.cjs, listed in failed: [T]
M2 test that SIGKILLs itself exit 1, named [T]
M3 test with a syntax error exit 1, named [T]
M4 empty sites/meshview-info/ exit 1, "no info site tests found" [T]
M5 folder missing exit 1, "sites/meshview-info not found" [T]
M6 test-zz.mjs exiting 1 exit 0, ignored → N2 [T]
M7 run from / works [T]

M1–M5 are killed, M6 survives (N2). I did not mutate the workflow YAML itself, since GitHub Actions cannot be run locally.

Always-list

Not verified

  • The remaining CI/CD Pipeline jobs (still pending at review time).
  • shellcheck (not installed here); I ran sh -n and exercised the script instead.
  • Behaviour on a fork PR or on a push to master (cannot be triggered from here).
  • That npm ci / Playwright install time stays near 40 s without a warm cache (the first run saved the cache).

Evidence tags: [T] tested/run by me, [A] read/analysed, [K] known behaviour.

@dborup
dborup merged commit 696660d into master Nov 28, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants