Skip to content

Test Harness Reference

This reference documents the relationship between CI and local test commands, enabling developers to reproduce CI behavior locally. CI is nixbot on magnetite plus a few GitHub Actions workflows; see CI Jobs for the full job reference.

All local commands run from the repository root.

CI context or jobPurposeLocal equivalentRuns on
nixbot/nix-evalEvaluate checks.x86_64-linux and checks.aarch64-darwin; a darwin evaluation error fails itnix eval .#checks.<system> --apply builtins.attrNamesPR, batch, push
nixbot/nix-buildBuild checks.x86_64-linux, and checks.aarch64-darwin best-effortjust check-fast auto off x86_64-linux; just check-fast on a MacPR, batch, push
nixbot/effects (pre-merge)Build each effect’s dependencies, including the rehearsalsnix build .#checks.x86_64-linux.deploy-docs-rehearsal .#checks.x86_64-linux.release-rehearsalPR, batch
docs effect, main triggerProduction docs deploy (deploy-docs production --rev <commit>)just docs-deploy-productionPush to main
release-packages effect, main triggerSemantic-release per package (release-packages --rev <commit>)just release-package <pkg> true (dry run; needs GITHUB_TOKEN)Push to main
release-packages effect, pullRequest triggerPer-package release forecast for a pull request (release-packages plan): the pull request’s commits on a simulated merge, main’s files, configuration, and plugins, nixbot’s installation token only, no push; reported as the release-plan check run and RELEASE-PLAN: log linesNone; just release-package <pkg> true on a main checkout previews without the pull request’s commitsPR after a green build, forks included (informational)
docs effect, pullRequest triggerCloudflare Preview pr-<number> for a pull request (deploy-docs pull-request), reported as the docs-preview check run whose details link is the Preview URLjust docs-deploy-preview pr-<number>PR (informational)
docs effect, pullRequestClosed triggerDelete the pull request’s Preview (deploy-docs pull-request-closed)NonePR closed or merged
PR Check: check-fast-forwardFast-forward merge is possiblegit merge-base --is-ancestor origin/main HEADPR
CD: bootstrap-verificationMakefile bootstrap on clean Ubuntumake bootstrap && make verify && make setup-userManual dispatch

checks.x86_64-linux covers the overlay packages, the docs package tests (package-vanixiets-docs-test-*), dev shells, the nixos-* and home-manager-* configurations, and the structure, secrets, and treefmt checks. From darwin, just check-fast auto off x86_64-linux routes the build to magnetite.

checks.aarch64-darwin, the darwin-<host> machine checks included, is built best-effort on stibnite, the only Mac magnetite dispatches to (modules/checks/nixbot-best-effort-darwin.nix). A failed darwin attribute is an ignored failure: shown on the build, excluded from its aggregate status, and retried on the next build. nixbot cannot tell an absent Mac from a genuine darwin regression, so local just check-fast on a Mac remains the gate for darwin.

An effect contains no behaviour of its own: it is a data entry in vanixiets.effects that names a program and its triggers, and the effects interpreter generates the glue that runs it. The effects run only on pushes to main or, for the effects’ pull request triggers, on a pull request event evaluated from main, and the main triggers hold deploy secrets, so pull requests validate them through hermetic checks that run the real programs and the generated glue against stubs:

CheckProgram under testStubs
deploy-docs-rehearsalEvery deploy-docs mode: production including a superseded run; preview including the untrusted --payload hardening; pull-request with the same-repository-or-writer trust rule, the build lookup accepting succeeded and skipped_local, each failure path, and the docs-preview check-run lifecycle; pull-request-closed for a deleted, absent, and failing Preview; versions and deployments --limit truncation; missing secretsStub wrangler that also runs each argv through the real pinned wrangler (deploy --dry-run, other commands against a loopback fake Cloudflare API), stub nixbot API, stub GitHub check-runs API
release-rehearsalrelease-packages --rev: a full semantic-release with the production plugins, including the floating major and minor tags, a superseded rev, and a diverged rev. release-packages plan on fixture pull requests: minor, major (feat!:), and no-release forecasts; a release-configuration edit that is ignored in favour of main’s; merge conflict, head mismatch, and missing forge token failures; an unused release PAT; zero writes to the fixture remote and no release createdLocal git fixture with refs/pull/<number>/head refs, stub GitHub API with check runs and the installation-token path
effects-interpreterThe script the interpreter generates for each trigger kind (main, pullRequest, pullRequestClosed): main-only guard, per-trigger secret export with no trigger receiving another trigger’s secrets, missing-secret failure, per-trigger forge token, exact argv including --revStub program, stub id-token endpoint

The effects list their rehearsals among their inputs, so the required nixbot/effects context fails when either fails; effects-interpreter is built by nixbot/nix-build. release-rehearsal proves the release and forecast machinery on a fixture; the release-plan check run is the forecast for the actual pull request.

The following recipes are not exercised by CI:

RecipeRationale
activate*Requires physical machine access
darwin-*Requires darwin hardware; nixbot builds the darwin-<host> checks best-effort and runs none of these recipes
nixos-bootstrapDestructive disk operations
cache-darwin-systemRequires darwin hardware
scan-secretsLocal gitleaks scan; no CI job runs it
sops-*Requires Bitwarden access
docs-deploy-*, docs-deployments, docs-versions, docs-tailRun deploy-docs locally with secrets/shared.yaml credentials; CI deploys through the docs effect
release-packageLocal dry run; CI releases through the release-packages effect
Terminal window
# Specific check, with logs
nix build -L .#checks.x86_64-linux.<name>
# Every check for the current system
just check-fast
# Full nix flake check, including VM tests
just check
Terminal window
nix build -L .#checks.x86_64-linux.deploy-docs-rehearsal
nix build -L .#checks.x86_64-linux.release-rehearsal
Terminal window
# Full package test
just test-package docs
# Individual test types
just docs-test-unit
just docs-test-e2e
just docs-test-coverage
Terminal window
just ci-status pr-check.yaml
just ci-logs-failed pr-check.yaml