Run The Full Test Suite In CI
P1 priority Donep1-ts-run-the-full-test-suite-in-ciCI runs only the HTML check, not the full chain
- Stage
- 03-done
- Author
- Ivan Hawkes
- Created
- Completed
The deploy gate checks generated HTML only: seven checks are local.
Run The Full Test Suite In CI
.github/workflows/hugo.yml deploys on a push to publish. Its build job runs
pnpm run test:html as the only validation step before upload-pages-artifact,
so the other seven steps of pnpm run test are local habits with no
enforcement: test:lint, test:headings, test:placeholders, test:kanban
and test:prettier never run in CI, and go test ./cmd/kan runs nowhere at
all.
The checks that guard card front matter, page headings, image placeholder pairing and the Prettier boundary are the ones most likely to break on a content edit, and a broken one publishes silently. CI also builds the site itself, so the chain can run against the build it already performs.
Goals
- Run the whole
pnpm run testchain in the build job, reusing the build the workflow already performs rather than building twice. - Add
go test ./cmd/kanto the job, so the scaffolder’s contract is covered as well. - Fail the job before the Pages artifact is uploaded, so a failed check cannot publish.
- Keep the workflow readable: one validation step named after the chain, not seven near-identical steps.
Acceptance Criteria
- A push to
publishruns every step ofpnpm run testandgo test ./cmd/kan. - The artifact is uploaded only when all of them pass.
- The site is built once per job, not once per check.
- Introducing a heading, placeholder, card schema, lint or Prettier setup
break on
publishfails the run.
Notes
- One step in the build job,
pnpm run test:ci, in the slottest:htmlheld: after the Tailwind and Hugo builds, beforeupload-pages-artifact. A step that exits non-zero fails the job, so the artifact carries only a build every check cleared, and the job builds the site once. - The chain’s two build steps are not part of the CI set.
test:csswrites an un-minified stylesheet andtest:hugorewritespublic/un-minified, without--environment productionand the Pages--baseURL: run there, they replace the production output the artifact uploads.test:checksis the six checks of the chain -test:lint,test:html,test:headings,test:placeholders,test:kanban,test:prettier- andpnpm run testis nowtest:css,test:hugo,test:checks, so the local chain and the CI gate judge the same things. go test ./cmd/kanfailed the moment it was run, and it had never been run:TestEveryKindHasArchetypelooked for the archetypes underthemes/be-best/archetypes/, the submodule layout the theme move to the repository root abandoned, so all 12 kinds reported a missing archetype. The path isbe-best/archetypes/now, and the suite passes.- The gate was run in CI order over a minified production build:
pnpm run build && pnpm run test:ciexits 0 -html-validatesilent, 418 pages with oneh1each, 44 pages with images and 58 placeholder pairs, 44 cards against the schema, prettier setup green,go testok. - Acceptance criterion 4 was proven by injection, one break at a time, each
undone before the next: strip an
<h1>from a generated page, add a card carrying a field the schema forbids, deletelayouts/from.prettierignore, add a script with an undefined call, add an image placeholder class with no rule behind it. Each madepnpm run test:ciexit 1, and the clean tree went back to 0. - The workflow’s CSS step is untouched (
pnpm dlx @tailwindcss/cliwith--minify), and the checks need nothing past thepnpm ithe job already runs: the six checks,prettierandeslintare dependencies, andgit ls-filesworks on a checkout made withfetch-depth: 0. - Not verified: GitHub’s runner. The sequence ran on one machine in this
checkout, and the local build did not carry
--environment productionor the Pages--baseURL, so absolute links in the built pages are the config’s, not the deployment’s. - The documents that described the old gate moved with the change: the
publishing behaviour in the functional specification, the publishing
integrity, quality gate and verification rows of the requirements, the build
and publishing section of the technical specification - where
pnpm run servealso became the script’s real name,server- and the decision record, whose row on HTML validation is marked superseded in part and is joined by the row that records the gate.