From 316b8548a2c39d81635fbc4ce8067fe1f2342785 Mon Sep 17 00:00:00 2001 From: "developing-today[bot]" <5454422+developing-today[bot]@users.noreply.github.com> Date: Wed, 4 Nov 2026 21:44:11 -0600 Subject: [PATCH] ci(github-backup): wire the regression suite into a workflow (#5937) The infra/github-backup regression suite (10 files, ~250 checks over clone/reconcile/drain/deploy safety) was enumerated by no workflow and had no documented CI runner, so it ran only when a human remembered. Add .github/workflows/github-backup-tests.yml (dispatch-triggered, matching the house pattern since 5a94833ea3): runs every tests/test_*.py file as a script and fails if any file exits non-zero. The three test_deploy_*.py modules execute at import time and end in sys.exit, so unittest discover errors on them; running the suite file-by-file as scripts covers all 10 files. The step also fails if the glob matches nothing, so a green run cannot be a silently skipped suite. Node is provisioned because the deploy tests drive deploy.mjs. Verified on the laptop: all 10 files pass as scripts; a negative test (one deliberately failing file) confirms the step fails and still runs the remaining files. README tests/ row now names the workflow as the CI runner. --- .github/workflows/github-backup-tests.yml | 83 +++++++++++++++++++++++ infra/github-backup/README.md | 2 +- 2 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/github-backup-tests.yml diff --git a/.github/workflows/github-backup-tests.yml b/.github/workflows/github-backup-tests.yml new file mode 100644 index 0000000000..6376bb6e76 --- /dev/null +++ b/.github/workflows/github-backup-tests.yml @@ -0,0 +1,83 @@ +name: github-backup tests + +# Test verification for infra/github-backup (#5937). +# +# The github-backup regression suite (tests/, 10 files, ~250 checks over +# clone/reconcile/drain/deploy safety) was enumerated by no workflow and +# had no documented CI runner, so it executed only when a human +# remembered. This workflow runs every file in the suite and fails when +# any file exits non-zero. +# +# The tests are plain python3 scripts (stdlib only, no deps) that exit +# non-zero on failure. Three of them — the test_deploy_*.py modules — +# execute their checks at import time and end in sys.exit at module +# level, so `python3 -m unittest discover` errors on them (errors=3) +# instead of running them. The suite is therefore run file-by-file as +# scripts, which is also how the modules document their own invocation +# ("Run: python3 infra/github-backup/tests/test_*.py"). The run step +# counts the files it executed and fails if the glob matched nothing, +# so a green run can never be a silently skipped suite. +# +# The deploy tests drive the real deploy.mjs with stubbed +# bws/wrangler/git executables, so the job provisions Node as well as +# Python. The remaining tests shell out to the real git CLI, which the +# runner image provides. +# +# Trigger policy matches the house pattern since 5a94833ea3: +# dispatch/schedule only, no push/pull_request triggers. +# CI tier policy: see .github/ci-policy.md. + +on: + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + tests: + name: "github-backup: regression suite" + runs-on: ubuntu-latest + timeout-minutes: 20 + steps: + - name: Checkout + uses: actions/checkout@v7 + + - name: Set up Python + uses: actions/setup-python@v7 + with: + python-version: "3.12" + + - name: Set up Node + uses: actions/setup-node@v7 + with: + node-version: 24 + + - name: Run the github-backup regression suite (each file as a script) + run: | + fail=0 + count=0 + for t in infra/github-backup/tests/test_*.py; do + count=$((count + 1)) + echo "::group::$t" + if python3 "$t"; then + echo "PASS: $t" + else + echo "::error::FAIL: $t" + fail=1 + fi + echo "::endgroup::" + done + echo "Ran $count test file(s)." + if [ "$count" -eq 0 ]; then + echo "::error::No test files matched infra/github-backup/tests/test_*.py — the suite was not run." + exit 1 + fi + if [ "$fail" -ne 0 ]; then + echo "::error::github-backup regression suite: at least one file failed (see above)." + exit 1 + fi + echo "github-backup regression suite: all $count files passed." diff --git a/infra/github-backup/README.md b/infra/github-backup/README.md index 2554c7bd3b..250f8523b2 100644 --- a/infra/github-backup/README.md +++ b/infra/github-backup/README.md @@ -65,4 +65,4 @@ reconcile-YYYY-MM-DD.md weekly sweep reports | `worker/` | Cloudflare Worker webhook receiver (wrangler) | | `systemd/` | laptop user units + timers + installer | | `docs/RUNBOOK.md` | copy-paste operations: install, add org, upgrade, DR | -| `tests/` | regression tests (plain python3, no deps) | +| `tests/` | regression tests (plain python3, no deps; run by the github-backup tests workflow, #5937) |