From e1a5c87e5d65ec836b011c4dafa4d38218013f50 Mon Sep 17 00:00:00 2001 From: Andrew Rogers <87336074+rogers-andrew@users.noreply.github.com> Date: Thu, 3 Dec 2026 10:56:04 -0800 Subject: [PATCH 1/4] Plan a workflow that runs every Runvil test workflow A new workflow in this repository, All tests, has a Run workflow button that starts the CI workflow of each of the nine Runvil repositories that hold code, on master, and three longer test workflows (STT Miri, Installers, Bundle) when their boxes are ticked. It waits for every run and writes one summary page: each run's result, commit, duration, and test counts read from its job logs, then every failed job and failed test with links. Starting runs in the other eight repositories needs a token that an admin stores as the secret RUNVIL_ALL_TESTS_TOKEN here. Six of the CI workflows accept a by-hand start only after a one-line change each, which goes in its own pull request. Plan: /vibe/2026-12-03-1-run-all-tests-workflow.md Co-Authored-By: Claude Opus 5.5 --- vibe/2026-12-03-1-run-all-tests-workflow.md | 206 ++++++++++++++++++++ 1 file changed, 206 insertions(+) create mode 100644 vibe/2026-12-03-1-run-all-tests-workflow.md diff --git a/vibe/2026-12-03-1-run-all-tests-workflow.md b/vibe/2026-12-03-1-run-all-tests-workflow.md new file mode 100644 index 000000000..977c6f5eb --- /dev/null +++ b/vibe/2026-12-03-1-run-all-tests-workflow.md @@ -0,0 +1,206 @@ +--- +name: One button that runs every Runvil test workflow +overview: A new workflow in cppalliance/runvil, All tests, starts the CI workflow of each of the nine Runvil repos that hold code, on master, and three longer test workflows when a person asks for them. It waits for every run, then writes one summary page with each run's result, its failed jobs and failed tests, and test counts read from the job logs. Six other repos each gain one line in their CI workflow so that it can be started this way. +todos: + - id: plan-copy + content: "Commit this plan alone on the branch run-all-tests" + status: pending + - id: script + content: "Add tools/run-all-tests.mjs and tools/run-all-tests.test.mjs, the scripts job in ci.yml, all-tests.yml, and workflow_dispatch in runvil's ci.yml" + status: pending + - id: local + content: "Run the unit tests, a read-only --existing run against today's master runs, actionlint, docs-claims, and vibelight" + status: pending + - id: one-line-prs + content: "With Andrew's yes, fork the four Plugin repos and add workflow_dispatch to ci.yml in runvil-harness, runvil-workshop, and the four Plugin repos, one branch and one PR each" + status: pending + - id: token + content: "After the runvil PR merges, an admin creates the token and stores it as RUNVIL_ALL_TESTS_TOKEN in cppalliance/runvil" + status: pending + - id: first-run + content: "Click Run workflow and record the result in this plan" + status: pending +isProject: false +--- + +# One button that runs every Runvil test workflow + +This plan uses these terms: + +- **CI workflow**: `.github/workflows/ci.yml` in a Runvil repo. GitHub runs it on every push to `master` and on every pull request, and its `ci-green` job is the check that branch protection requires. +- **The nine repos**: the Runvil repos that hold code and a CI workflow: `runvil`, `runvil-harness`, `runvil-workshop`, `runvil-gateway`, `runvil-cloud-providers`, `runvil-plugin-api`, `runvil-plugin-bashkit`, `runvil-plugin-std`, and `runvil-plugin-web`, all owned by `cppalliance`. `runvil-classroom`, `runvil-design`, and `runvil-docs` hold only prose. +- **Dispatch**: starting a workflow by hand, with the Run workflow button on its Actions page or with the REST call `POST /repos/{owner}/{repo}/actions/workflows/{file}/dispatches`. GitHub accepts a dispatch only for a workflow whose `on:` block lists `workflow_dispatch`. +- **Extras**: three test workflows that take longer than CI and accept a dispatch already. STT Miri (`runvil-gateway/.github/workflows/stt-miri.yml`, up to about 31 minutes) checks the Gateway's speech-to-text code under Miri, Rust's interpreter that detects undefined behavior. Installers (`runvil/.github/workflows/installers.yml`, about 20 minutes) builds the five installers and installs them on five kinds of machine. Bundle (`runvil-workshop/.github/workflows/bundle.yml`, about 18 minutes) builds Workshop's signed bundles. A dispatched Installers run keeps its installers as workflow artifacts for 7 days and publishes a release only for a pushed `vX.Y.Z` tag. Bundle keeps its bundles as workflow artifacts, and the Installers workflow publishes releases. +- **The token**: a GitHub token stored as the repository secret `RUNVIL_ALL_TESTS_TOKEN` in `cppalliance/runvil`. The token GitHub gives each workflow run can act only on the repo it runs in, so starting and reading runs in the other eight repos needs this second token. +- **Test counts**: the number of tests passed, failed, and skipped, read from the text each test runner prints in a job's log. + + + +## Product Requirements + +Each of the nine repos tests itself on every push to `master`, so "does every Runvil test pass" today means opening nine Actions pages, or building and running all nine suites on one machine. On 2026-12-03 a local run of all nine suites on Andrew's 8-core machine kept the load average near 17 and filled the disk to 6.4 GB free. All tests moves that work to GitHub's runners and puts the answer on one page. + +- Problem and users: + - Andrew owns Runvil's CI; Vinnie Falco assigned it to him in class 8 on 2026-11-19. Anyone with write access to `cppalliance/runvil` can use the button. + - A person who wants to know whether every test passes on `master` now has nine pages to read, and the extras run only when someone starts each one. +- Goals: + - One Run workflow button, on the All tests page of `cppalliance/runvil`'s Actions tab, dispatches the CI workflow of each of the nine repos on `master`. + - Three checkboxes on the same form, unticked by default, add STT Miri, Installers, and Bundle. + - When every run has finished, the All tests run's Summary page shows each run's result, commit, duration, and test counts, and lists every failed job and failed test with links. +- Non-goals: + - Changing what any CI workflow or extra tests. + - Testing a branch other than `master`, or a pull request. +- Success criteria: + - A click with the boxes unticked ends in about the time of the slowest CI run (Gateway CI took 12 to 13 minutes on 2026-11-30) plus up to one minute. + - The All tests run ends green exactly when every run it started ends in success. + - The test counts of a run match the counts its own job logs print. +- Constraints: + - Andrew's access on all nine repos is write, one level below admin (checked 2026-12-03 with `gh api repos/cppalliance/`). GitHub lets only admins add repository secrets, so an admin creates the token and the secret. + - The script runs on Node 22 with the standard library only, like `tools/docs-claims.mjs`, so the job runs it straight after checking out the repo and setting up Node. + - Each CI workflow puts its runs in the concurrency group `${{ github.workflow }}-${{ github.ref }}` with `cancel-in-progress: true`, so a dispatched run on `master` and a push to `master` share one group, and a push during the All tests run cancels the dispatched run. +- Open questions: None + +## Functional Specification + +A person clicks Run workflow, ticks the extras they want, and confirms. One job dispatches every selected workflow on `master`, waits until all of them finish, reads their jobs and job logs, and writes the summary. The job fails when any started run fails, is cancelled, or could not start. + +- Actors and workflows: + - A person with write access to `cppalliance/runvil` starts All tests from the Actions tab. GitHub lets only such people dispatch a workflow. + - The All tests job runs `node tools/run-all-tests.mjs`, with one `--extra ` argument per ticked box. + - The script dispatches each workflow with `return_run_details: true`, so GitHub answers with the new run's ID, and then reads that run's state once a minute. +- Inputs and outputs: + - Inputs: the booleans `stt-miri`, `installers`, and `bundle`, and the token in `GH_TOKEN`. + - The script writes the summary to the file `$GITHUB_STEP_SUMMARY` names, which GitHub shows on the run's Summary page, and prints the same Markdown to the job log. Run outside Actions, it prints only. + - The summary opens with one line giving how many runs passed out of how many started. + - A table follows, one row per workflow. Its columns are the run (repo and workflow, linked to the run), the commit (short SHA, linked), the result, the minutes from start to finish, and the test counts as passed, failed, and skipped. + - One entry follows for each job that failed, timed out, or was cancelled. It links the job and lists the names of its failed tests, up to 20, then the number left out. + - For each workflow GitHub refused to start, an entry gives the HTTP status and GitHub's message. + - A note under the table says that the counts add up every job, so a suite that CI runs on three systems counts three times. +- States and validation: + - Each workflow moves from dispatched to queued, in progress, and completed, or ends as not started when GitHub refuses the dispatch. + - A run's result is GitHub's `conclusion`: `success`, `failure`, `cancelled`, `timed_out`, or another value GitHub reports, shown as GitHub writes it. + - Test counts come from three line formats. cargo-nextest prints `Summary [...] N tests run: N passed, N failed, N skipped`, with `(N slow)` after passed in some runs. `cargo test` prints one `test result: ok. N passed; N failed; N ignored; ...` line per test binary. `node --test` on Node 22 prints TAP, the Test Anything Protocol, with `# pass N`, `# fail N`, `# skipped N`, `# cancelled N`, and `# todo N` lines per run. Cancelled counts as failed, and ignored and todo count as skipped. + - Failed test names come from nextest's `FAIL`, `TIMEOUT`, and `SIG...` lines, from `cargo test`'s `test ... FAILED` lines, and from TAP's `not ok N - ` lines, each name listed once. + - A job that runs other checks, such as `fmt` or `clippy`, shows its result alone. + - The script stops waiting 170 minutes after it starts; runs still going then are reported as still running and fail the All tests run. The job's own limit is 180 minutes. +- Errors and recovery: + - When `GH_TOKEN` is empty, the script fails at once with a message that names the secret `RUNVIL_ALL_TESTS_TOKEN` and the repo it belongs in. + - When GitHub refuses a dispatch (422 when the workflow's `on:` block lacks `workflow_dispatch`, 403 or 404 when the token cannot reach the repo), that workflow is reported as not started and the others go on. + - A failed read of a run's state or jobs (a network error or a 5xx status) is retried on the next minute's round, up to five times in a row for one run, then that run is reported with the last error. + - When a job's log cannot be downloaded, that job shows its result alone and the error is listed; the run's result still comes from GitHub. + - A cancelled CI run on `master` is listed with the reason most likely for it: a push to `master` cancels a dispatched CI run, and the newer push's own run tests the newer commit. + - Cancelling the All tests run leaves the runs it started running in their own repos. +- Security and privacy behavior: + - The token reaches the script only through the `GH_TOKEN` environment variable of its step, and GitHub masks secrets in logs. For a failed request the script prints the method, the address, the status, and GitHub's message, and never the request headers. + - The workflow sets `permissions: {}` for the run's own token, because the script uses only the secret. + - The nine repos are public, so the summary shows only results and logs that anyone can read already. +- Acceptance criteria: + - With the boxes unticked, the summary lists nine CI runs, and the All tests run passes when all nine pass. + - Before the six one-line pull requests merge, the six workflows whose `on:` block lacks `workflow_dispatch` appear as not started with GitHub's 422 message, and the run fails. + - The counts for today's `master` runs match their logs: `runvil-harness` job `test` 3345 passed and 24 skipped, `runvil-workshop` job `check-workshop` 436 passed and 9 skipped, `runvil-plugin-api` job `test (ubuntu-latest)` 271 passed. + + + + +## Technical Design + +A new dispatch-only workflow in `cppalliance/runvil` runs a Node script that drives the GitHub REST API with `fetch`. The script's line parsers and summary writer are plain functions that its tests import. The other repos change by one line each in their CI workflow. + +- Architecture: + - `.github/workflows/all-tests.yml`: `on: workflow_dispatch` with the three boolean inputs; `concurrency: { group: all-tests, cancel-in-progress: false }`, so a second click waits for the first run; `permissions: {}`; one job on `ubuntu-latest` with `timeout-minutes: 180` that checks out the repo, sets up Node 22, and runs the script with `GH_TOKEN: ${{ secrets.RUNVIL_ALL_TESTS_TOKEN }}`. + - The script calls four endpoints, all under `https://api.github.com/repos/cppalliance//actions`. + - `POST /workflows//dispatches` with `{"ref": "master", "return_run_details": true}` returns 200 with `workflow_run_id`, `run_url`, and `html_url`. + - `GET /runs/` gives the run's `status`, `conclusion`, `head_sha`, `run_started_at`, and `updated_at`. + - `GET /runs//jobs?filter=latest&per_page=100` gives the jobs, page by page through the `Link` header. + - `GET /jobs//logs` answers 302 with a download address that is valid for one minute; `fetch` follows it and drops the `Authorization` header when it leaves `api.github.com`. + - Each request sends `Accept: application/vnd.github+json`, `X-GitHub-Api-Version: 2022-11-28`, and a 30-second timeout. +- Modules and interfaces: + - `tools/run-all-tests.mjs` holds the list of workflows (the nine CI workflows and the three extras) and exports `parseTestCounts(logText)`, `renderSummary(results)`, and `runAllTests({ request, extras, existing, now, sleep })`. `request` is the function that performs one HTTP call, which the tests replace with a stand-in GitHub. + - The file runs its command-line entry only when it is the program Node started, so the tests can import it. + - `--existing` replaces each dispatch with a read of the workflow's newest completed run on `master` (`GET /workflows//runs?branch=master&status=completed&per_page=1`). It only reads, and it is how a person checks the summary against runs that have already finished. + - `tools/run-all-tests.test.mjs` holds the tests (`node:test`). +- File and public API changes: + - `cppalliance/runvil`: add `.github/workflows/all-tests.yml`, `tools/run-all-tests.mjs`, and `tools/run-all-tests.test.mjs`; in `.github/workflows/ci.yml` add `workflow_dispatch:` to `on:`, add a job `scripts` that runs `node --test tools/run-all-tests.test.mjs` on Node 22, and add `scripts` to the `needs:` list of `ci-green`. + - `runvil-harness`, `runvil-workshop`, `runvil-plugin-api`, `runvil-plugin-bashkit`, `runvil-plugin-std`, and `runvil-plugin-web`: add `workflow_dispatch:` under `on:` in `.github/workflows/ci.yml`. `runvil-gateway` and `runvil-cloud-providers` list it already. +- Data, persistence, failure, security, and privacy constraints: + - The script keeps its state in memory for one run, and each run starts from the workflow list in its source. + - The token needs, on each of the nine repos, the fine-grained permission Actions: Read and write (dispatch needs write, and reading runs, jobs, and logs needs read). Its owner must have write access to all nine repos. + - Request volume: twelve runs read once a minute for at most 170 minutes is about 2,000 requests, plus about two per job for logs, which stays under the 5,000 requests an hour GitHub allows one token. + + + + +## Testing Plan + +Unit tests cover the three log formats and the summary, using lines copied from real job logs. A test with a stand-in GitHub drives the whole flow. A read-only run against the real runs of 2026-12-03 checks the counts, and the first click after merge checks the real dispatch. + +- Unit: + - `parseTestCounts` on excerpts of today's logs: nextest from `runvil-harness` job `test` (3345 passed, 24 skipped) and a failing nextest summary (`430 tests run: 426 passed (6 slow), 4 failed, 13 skipped` with four `FAIL` lines, each name listed twice in the log); `cargo test` from `runvil-plugin-api` (six `test result:` lines adding to 271 passed); TAP from `runvil-harness` job `wording` (3 passed), and a TAP block with a `not ok` line. Each excerpt keeps the timestamp GitHub puts before every line and the byte-order mark at the start of a log. + - `renderSummary`: the counts line, a row with a failed job and its test names, a not-started workflow with its message, and the cap at 20 names. +- Integration and end-to-end: + - `runAllTests` against a stand-in GitHub: one dispatch answered 200, one refused with 422, a run that goes from queued to completed over three rounds, two pages of jobs, and job logs. The test checks the summary and that the run counts as failed. + - A read-only local run, `GH_TOKEN=$(gh auth token) node tools/run-all-tests.mjs --existing`, against the `master` runs of 2026-12-03, compared with the counts under Acceptance criteria. + - One `gh api` dispatch of `runvil-cloud-providers`'s CI (about one minute; it accepts dispatches already) with `return_run_details: true`, to confirm the response fields, only with Andrew's yes because it starts a run under his name. + - After merge and the secret: one click with the boxes unticked. +- Regression, security, and performance: + - `node --test tools/docs-claims.mjs` and `node --test tools/run-all-tests.test.mjs`. + - actionlint on `all-tests.yml` and `ci.yml`. + - vibelight in the repo root. +- Exit criteria: + - Every test above passes, the `--existing` counts match, and the first real click produces a summary whose rows match the runs it started. + + + + +## Decision Record + +- Decisions: + - The button and the script live in `cppalliance/runvil`, and an admin stores the token there. The team sees one page, and each CI run happens in its own repo with its own cache, as on a push. Andrew chose "runvil + admin token". + - All tests always starts the nine CI workflows, and the form offers the extras as checkboxes that start unticked. Andrew chose "CI + optional extras". + - The summary shows job results and test counts read from job logs, with failed test names. Andrew chose "Jobs, plus test counts", accepting that a change in a test runner's output format can stop the counts until the parser follows it. + - Andrew's fork of each of the four Plugin repos (`runvil-plugin-api`, `runvil-plugin-bashkit`, `runvil-plugin-std`, `runvil-plugin-web`) is created for their pull requests. Andrew chose "Create the four forks". + - The script reads the run ID from the dispatch response, using `return_run_details`, which GitHub added on 2026-02-19. Matching runs by start time could pick a push run that started in the same minute. +- Rejected alternatives: + - One combined run in which `runvil`'s workflow calls each CI workflow as a reusable workflow. It works with the run's own token, but each called workflow checks out the calling repo, so every checkout step in all nine CI workflows would need a repository argument, and all nine repos' caches would share `runvil`'s 10 GB cache limit and evict `runvil`'s own. Revisit if the token cannot be had. + - A repo of Andrew's own holding his personal token. Only he would see the button, and runs would start under his name. Revisit if an admin cannot create the token. + - Re-running each repo's last `master` run through the re-run API. It works with the CI workflows as they are, but GitHub re-runs only runs younger than 30 days, and the re-run replaces the original run's results as its second attempt. + - Running every suite on a developer's machine, which loaded the machine and filled its disk on 2026-12-03. +- Assumptions, risks, and notes: + - Assumption: Actions: Read and write is the fine-grained permission that dispatch, runs, jobs, and logs need. GitHub's REST pages name only the classic `repo` scope. The first real click confirms it. + - Assumption: the `cppalliance` organization allows fine-grained tokens on its repos. An organization can require an owner to approve each one. + - Risk: a fine-grained token expires on the date its creator sets, and the All tests run then fails at its first dispatch with 401. A GitHub App owned by the organization avoids expiry, at the cost of an app ID and private key as two secrets and a step that mints a token. + - Risk: a push to `master` during a run cancels that repo's dispatched CI run, and the summary reports it cancelled. + - Note: CI tests Workshop's crates `workshop`, `workshop-server`, and `workshop-server-api` on Windows only; on Linux it only builds them. A local Linux run on 2026-12-03 had 4 failures among their 430 tests while the machine was heavily loaded. All tests reports what CI runs and leaves this gap as it is. + +### Deferred and Out of Scope + +- Deferred: a checkbox for `--existing` on the form. Revisit if people want a summary of the last runs without starting new ones. +- Deferred: a nightly schedule for All tests. Revisit once the button has run for a week. +- Out of scope: what each CI workflow tests, including a Linux job for Workshop's three app crates, which needs its own plan. + + + + +## Project Survey + +None + + + + +## Execution Instructions + +- Work items: + - Commit this plan alone on the branch `run-all-tests`, made from `upstream/master`. + - Add `tools/run-all-tests.mjs`, `tools/run-all-tests.test.mjs`, and `.github/workflows/all-tests.yml`, and change `.github/workflows/ci.yml`, in one commit. + - Run the Testing Plan's local checks and record the results in this plan. + - With Andrew's yes, create the four Plugin forks, and in each of the six repos make the branch `run-all-tests` from `upstream/master` with one commit adding `workflow_dispatch:`. + - With Andrew's yes, push the seven branches to his forks and open the seven pull requests, `runvil` first; the other six link to it. + - After the `runvil` pull request merges, ask an admin to create the token and the secret. + - Click Run workflow, and record the result in this plan. +- Dependencies and verification: + - The six one-line pull requests and the `runvil` pull request can merge in any order. Until a repo's line merges, its row reads not started. + - GitHub shows the Run workflow button only once `all-tests.yml` is on `master` of `cppalliance/runvil`. + - A local run needs Node 22 or later and a token in `GH_TOKEN`; `--existing` needs only read access. + + From 7ded4e09b1809ab5bf55a0157a473298f1b590a1 Mon Sep 17 00:00:00 2001 From: Andrew Rogers <87336074+rogers-andrew@users.noreply.github.com> Date: Thu, 3 Dec 2026 11:04:17 -0800 Subject: [PATCH 2/4] Add the All tests workflow, which runs every Runvil CI workflow A person starts All tests with the Run workflow button on this repository's Actions tab. tools/run-all-tests.mjs dispatches the CI workflow of each of the nine Runvil repositories that hold code, on master, plus STT Miri, Installers, and Bundle for each ticked box. It reads each run's state once a minute, and when every run has finished it reads their jobs and job logs. It writes one summary to the run's Summary page: each run's result, commit, duration, and test counts, then every failed job and failed test with links. Test counts come from the summary lines that cargo-nextest, `cargo test`, and `node --test` print in a job's log. A dispatch that GitHub refuses, such as one for a CI workflow whose `on:` block lacks `workflow_dispatch`, shows as not started, and the other runs go on. The script acts with the repository secret RUNVIL_ALL_TESTS_TOKEN, because a run's own token reaches only its own repository. `ci.yml` gains `workflow_dispatch` and a `scripts` job that runs the script's tests, which `ci-green` now waits for. Plan: /vibe/2026-12-03-1-run-all-tests-workflow.md Co-Authored-By: Claude Opus 5.5 --- .github/workflows/all-tests.yml | 62 +++++ .github/workflows/ci.yml | 15 +- tools/run-all-tests.mjs | 434 ++++++++++++++++++++++++++++++++ tools/run-all-tests.test.mjs | 265 +++++++++++++++++++ 4 files changed, 775 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/all-tests.yml create mode 100644 tools/run-all-tests.mjs create mode 100644 tools/run-all-tests.test.mjs diff --git a/.github/workflows/all-tests.yml b/.github/workflows/all-tests.yml new file mode 100644 index 000000000..16bb08322 --- /dev/null +++ b/.github/workflows/all-tests.yml @@ -0,0 +1,62 @@ +name: All tests + +# One Run workflow button that starts, on master, the CI workflow of each +# Runvil repository that holds code, plus each longer test workflow whose +# box is ticked. The job waits for every run and writes one summary to this +# run's Summary page: each run's result, commit, duration, and test counts, +# then every failed job and failed test. tools/run-all-tests.mjs lists the +# workflows. +# +# Starting and reading runs in other repositories needs the repository +# secret RUNVIL_ALL_TESTS_TOKEN: a token with the permission Actions: Read +# and write on every repository the script lists, made by someone with +# write access to all of them. + +on: + workflow_dispatch: + inputs: + stt-miri: + description: Also run the Gateway's STT Miri workflow (up to about 31 minutes) + type: boolean + default: false + installers: + description: Also run the Installers workflow on five systems (about 20 minutes) + type: boolean + default: false + bundle: + description: Also run Workshop's Bundle workflow (about 18 minutes) + type: boolean + default: false + +# A second click waits until the first run has finished. +concurrency: + group: all-tests + cancel-in-progress: false + +# The checkout reads this repository; the script acts with the secret. +permissions: + contents: read + +jobs: + all-tests: + runs-on: ubuntu-latest + timeout-minutes: 180 + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 22 + + - name: Start every workflow and summarize the runs + env: + GH_TOKEN: ${{ secrets.RUNVIL_ALL_TESTS_TOKEN }} + STT_MIRI: ${{ inputs.stt-miri }} + INSTALLERS: ${{ inputs.installers }} + BUNDLE: ${{ inputs.bundle }} + run: | + args=() + if [ "$STT_MIRI" = true ]; then args+=(--extra stt-miri); fi + if [ "$INSTALLERS" = true ]; then args+=(--extra installers); fi + if [ "$BUNDLE" = true ]; then args+=(--extra bundle); fi + node tools/run-all-tests.mjs "${args[@]}" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c4320a69d..ca8a7acd7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,6 +4,7 @@ on: push: branches: [master, main] pull_request: + workflow_dispatch: concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -89,6 +90,18 @@ jobs: - name: Wording run: node --test tools/docs-claims.mjs + scripts: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 22 + + - name: Test the All tests script + run: node --test tools/run-all-tests.test.mjs + supply-chain: runs-on: ubuntu-latest steps: @@ -143,7 +156,7 @@ jobs: # or that job bypasses this gate. ci-green: runs-on: ubuntu-latest - needs: [fmt, clippy, test, docs, wording, supply-chain, dylint] + needs: [fmt, clippy, test, docs, wording, scripts, supply-chain, dylint] if: always() steps: - name: Verify every job succeeded diff --git a/tools/run-all-tests.mjs b/tools/run-all-tests.mjs new file mode 100644 index 000000000..ce40ff85e --- /dev/null +++ b/tools/run-all-tests.mjs @@ -0,0 +1,434 @@ +// Starts the test workflows of the Runvil repositories on master, waits for +// every run, and writes one summary: each run's result, commit, duration, +// and test counts, then every failed job and failed test. +// +// Usage: node tools/run-all-tests.mjs [--extra ]... [--existing] +// --extra also start a longer test workflow: stt-miri, +// installers, or bundle +// --existing start nothing, and summarize the newest finished run +// of each workflow on master +// +// Environment: +// GH_TOKEN a token with Actions read and write on every +// repository in CI_WORKFLOWS; --existing needs read +// only +// GITHUB_STEP_SUMMARY set by GitHub Actions; the summary is appended to +// the file it names as well as printed +// +// The All tests workflow (.github/workflows/all-tests.yml) runs this script +// with the repository secret RUNVIL_ALL_TESTS_TOKEN. +// +// Needs Node 22 or later, and no install. +import { appendFile } from "node:fs/promises"; +import { setTimeout as delay } from "node:timers/promises"; +import { parseArgs } from "node:util"; + +const OWNER = "cppalliance"; +const BRANCH = "master"; +const API = "https://api.github.com"; + +export const CI_WORKFLOWS = [ + "runvil", + "runvil-harness", + "runvil-workshop", + "runvil-gateway", + "runvil-cloud-providers", + "runvil-plugin-api", + "runvil-plugin-bashkit", + "runvil-plugin-std", + "runvil-plugin-web", +].map((repo) => ({ repo, file: "ci.yml", name: "CI" })); + +export const EXTRA_WORKFLOWS = { + "stt-miri": { repo: "runvil-gateway", file: "stt-miri.yml", name: "STT Miri" }, + installers: { repo: "runvil", file: "installers.yml", name: "Installers" }, + bundle: { repo: "runvil-workshop", file: "bundle.yml", name: "Bundle" }, +}; + +const POLL_MS = 60_000; +// The workflow's job stops at 180 minutes; stopping here first leaves time +// to read the finished runs and write the summary. +const DEADLINE_MS = 170 * 60_000; +const MAX_READ_FAILURES = 5; +const REQUEST_TIMEOUT_MS = 30_000; +const JOBS_PER_PAGE = 100; +const MAX_LISTED_TESTS = 20; + +// GitHub starts each line of a job log with a timestamp, and the log with a +// byte-order mark. +const LOG_PREFIX = /^?\d{4}-\d\d-\d\dT[\d:.]+Z /; +const COLOR = /\x1b\[[0-9;]*m/g; +const NEXTEST_SUMMARY = /^\s*Summary \[[^\]]*\] \d+(?:\/\d+)? tests? run: (.*)$/; +const NEXTEST_FAILURE = /^\s*(?:FAIL|TIMEOUT|ABORT|SIG[A-Z]+) \[\s*[\d.]+s\] (?:\(\s*\d+\/\d+\) )?(.+?)\s*$/; +const CARGO_RESULT = /^test result: \w+\. (\d+) passed; (\d+) failed; (\d+) ignored;/; +const CARGO_FAILURE = /^test (\S+) \.\.\. FAILED$/; +// `node --test` prints TAP on Node 22 and its spec format on later versions. +const NODE_COUNT = /^(?:#|ℹ) (pass|fail|cancelled|skipped|todo) (\d+)$/; +const TAP_FAILURE = /^\s*not ok \d+ - (.+?)(?: # .*)?$/; +const SPEC_FAILURE = /^\s*✖ (.+?) \([\d.]+m?s\)$/; +const NODE_BUCKET = { pass: "passed", fail: "failed", cancelled: "failed", skipped: "skipped", todo: "skipped" }; + +/** + * Reads the test counts that cargo-nextest, `cargo test`, and `node --test` + * print in one job log. + * + * @param {string} logText + * @returns {{ counts: { passed: number, failed: number, skipped: number } | null, failedTests: string[] }} + * `counts` is null when the log holds none of the three runners' summaries. + */ +export function parseTestCounts(logText) { + const counts = { passed: 0, failed: 0, skipped: 0 }; + const failedTests = new Set(); + let found = false; + for (const raw of logText.split(/\r?\n/)) { + const line = raw.replace(LOG_PREFIX, "").replace(COLOR, ""); + let match; + if ((match = NEXTEST_SUMMARY.exec(line))) { + found = true; + for (const [, n, outcome] of match[1].matchAll(/(\d+) (passed|failed|timed out|skipped)/g)) { + counts[outcome === "timed out" ? "failed" : outcome] += Number(n); + } + } else if ((match = CARGO_RESULT.exec(line))) { + found = true; + counts.passed += Number(match[1]); + counts.failed += Number(match[2]); + counts.skipped += Number(match[3]); + } else if ((match = NODE_COUNT.exec(line))) { + found = true; + counts[NODE_BUCKET[match[1]]] += Number(match[2]); + } else if ( + (match = NEXTEST_FAILURE.exec(line) ?? CARGO_FAILURE.exec(line) ?? TAP_FAILURE.exec(line) ?? SPEC_FAILURE.exec(line)) + ) { + failedTests.add(match[1]); + } + } + return { counts: found ? counts : null, failedTests: [...failedTests] }; +} + +/** + * Reads the command line. + * + * @param {string[]} args + * @returns {{ extras: string[], existing: boolean }} + */ +export function parseArguments(args) { + const { values } = parseArgs({ + args, + options: { extra: { type: "string", multiple: true }, existing: { type: "boolean" } }, + }); + const extras = values.extra ?? []; + for (const extra of extras) { + if (!Object.hasOwn(EXTRA_WORKFLOWS, extra)) { + throw new Error(`unknown --extra ${extra}; the extras are ${Object.keys(EXTRA_WORKFLOWS).join(", ")}`); + } + } + return { extras, existing: values.existing ?? false }; +} + +/** + * A GitHub REST API client for `runAllTests`. + * + * `call` answers `{ status, data, location }`: `data` is the parsed JSON + * body, and `location` the target of a redirect, which `call` leaves to the + * caller. `download` fetches a log from the address a redirect gave. + * + * @param {string} token + */ +export function githubClient(token) { + return { + async call(method, path, body) { + const response = await fetch(`${API}${path}`, { + method, + headers: { + Accept: "application/vnd.github+json", + Authorization: `Bearer ${token}`, + "User-Agent": "runvil-all-tests", + "X-GitHub-Api-Version": "2022-11-28", + ...(body === undefined ? {} : { "Content-Type": "application/json" }), + }, + body: body === undefined ? undefined : JSON.stringify(body), + // A log redirect points at a storage address outside GitHub's API, + // which must receive the request without the token. + redirect: "manual", + signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS), + }); + const text = await response.text(); + return { + status: response.status, + data: text === "" ? undefined : parseJson(text), + location: response.headers.get("location") ?? undefined, + }; + }, + async download(url) { + const response = await fetch(url, { signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS) }); + if (!response.ok) throw new Error(`download of a job log answered HTTP ${response.status}`); + return response.text(); + }, + }; +} + +function parseJson(text) { + try { + return JSON.parse(text); + } catch { + return { message: text.slice(0, 200) }; + } +} + +/** + * Starts every CI workflow, and each extra asked for, on master; waits for + * the runs; reads their jobs and logs; and returns the summary. + * + * @param {object} options + * @param {ReturnType} options.github + * @param {string[]} [options.extras] keys of EXTRA_WORKFLOWS + * @param {boolean} [options.existing] read the newest finished runs and start nothing + * @param {() => number} [options.now] + * @param {(ms: number) => Promise} [options.sleep] + * @param {(line: string) => void} [options.log] progress lines + * @returns {Promise<{ markdown: string, passed: boolean }>} + */ +export async function runAllTests({ github, extras = [], existing = false, now = Date.now, sleep = delay, log = console.log }) { + const workflows = [...CI_WORKFLOWS, ...extras.map((extra) => EXTRA_WORKFLOWS[extra])]; + const results = workflows.map((workflow) => ({ workflow, jobs: [], readFailures: 0 })); + for (const result of results) { + await start(github, result, existing); + if (result.runId !== undefined) log(`${label(result)}: ${runUrl(result)}`); + } + await waitForRuns(github, results, { now, sleep, log }); + for (const result of results) { + if (result.run?.status === "completed") await readJobs(github, result); + } + return { markdown: renderSummary(results, { existing }), passed: results.every(passedRun) }; +} + +async function start(github, result, existing) { + const { repo, file } = result.workflow; + const workflowPath = `/repos/${OWNER}/${repo}/actions/workflows/${file}`; + try { + if (existing) { + const response = await github.call("GET", `${workflowPath}/runs?branch=${BRANCH}&status=completed&per_page=1`); + if (response.status !== 200) { + result.startError = describe(response); + } else if (response.data.workflow_runs.length === 0) { + result.startError = `${file} has no finished run on ${BRANCH}`; + } else { + result.runId = response.data.workflow_runs[0].id; + } + return; + } + const response = await github.call("POST", `${workflowPath}/dispatches`, { ref: BRANCH, return_run_details: true }); + if (response.status === 200 && Number.isInteger(response.data?.workflow_run_id)) { + result.runId = response.data.workflow_run_id; + } else if (response.status === 204) { + result.startError = "GitHub started a run and answered HTTP 204 without its ID, so the run cannot be followed"; + } else { + result.startError = describe(response); + } + } catch (error) { + result.startError = errorText(error); + } +} + +async function waitForRuns(github, results, { now, sleep, log }) { + const deadline = now() + DEADLINE_MS; + let waiting = results.filter((result) => result.runId !== undefined); + for (;;) { + for (const result of waiting) await readRun(github, result); + waiting = waiting.filter((result) => result.run?.status !== "completed" && result.readError === undefined); + if (waiting.length === 0) return; + if (now() >= deadline) { + for (const result of waiting) result.stillRunning = true; + return; + } + log(`waiting for ${waiting.length} runs: ${waiting.map((result) => `${label(result)} (${result.run?.status ?? "not read yet"})`).join(", ")}`); + await sleep(POLL_MS); + } +} + +async function readRun(github, result) { + try { + const response = await github.call("GET", `/repos/${OWNER}/${result.workflow.repo}/actions/runs/${result.runId}`); + if (response.status === 200) { + result.run = response.data; + result.readFailures = 0; + return; + } + noteReadFailure(result, describe(response)); + } catch (error) { + noteReadFailure(result, errorText(error)); + } +} + +function noteReadFailure(result, message) { + result.readFailures += 1; + if (result.readFailures >= MAX_READ_FAILURES) result.readError = message; +} + +async function readJobs(github, result) { + const { repo } = result.workflow; + try { + for (let page = 1; ; page += 1) { + const response = await github.call( + "GET", + `/repos/${OWNER}/${repo}/actions/runs/${result.runId}/jobs?filter=latest&per_page=${JOBS_PER_PAGE}&page=${page}`, + ); + if (response.status !== 200) { + result.jobsError = describe(response); + return; + } + for (const job of response.data.jobs) result.jobs.push(await readJob(github, repo, job)); + if (response.data.jobs.length < JOBS_PER_PAGE) return; + } + } catch (error) { + result.jobsError = errorText(error); + } +} + +async function readJob(github, repo, job) { + const entry = { name: job.name, url: job.html_url, conclusion: job.conclusion, counts: null, failedTests: [] }; + if (job.conclusion === null || job.conclusion === "skipped") return entry; + try { + const response = await github.call("GET", `/repos/${OWNER}/${repo}/actions/jobs/${job.id}/logs`); + if (response.status !== 302 || response.location === undefined) { + entry.logError = describe(response); + return entry; + } + const parsed = parseTestCounts(await github.download(response.location)); + entry.counts = parsed.counts; + entry.failedTests = parsed.failedTests; + } catch (error) { + entry.logError = errorText(error); + } + return entry; +} + +function describe(response) { + const message = response.data?.message; + return message === undefined ? `HTTP ${response.status}` : `HTTP ${response.status}: ${message}`; +} + +function errorText(error) { + return error instanceof Error ? error.message : String(error); +} + +function label(result) { + return `${result.workflow.repo} ${result.workflow.name}`; +} + +function runUrl(result) { + return `https://github.com/${OWNER}/${result.workflow.repo}/actions/runs/${result.runId}`; +} + +function passedRun(result) { + return result.run?.status === "completed" && result.run.conclusion === "success" && result.readError === undefined; +} + +/** + * Writes the Markdown summary of the runs `runAllTests` followed. + * + * @param {object[]} results + * @param {{ existing?: boolean }} [options] + * @returns {string} + */ +export function renderSummary(results, { existing = false } = {}) { + const title = existing ? `Newest finished runs on ${BRANCH}` : "All tests"; + const lines = [ + `## ${title}: ${results.filter(passedRun).length} of ${results.length} runs passed`, + "", + "| Run | Commit | Result | Minutes | Tests passed / failed / skipped |", + "| --- | --- | --- | --- | --- |", + ...results.map(tableRow), + "", + "The test counts add up every job of a run, so a suite that a workflow runs on three systems counts three times. Skipped tests include those a job's filter leaves out.", + ]; + const problems = results.flatMap(problemLines); + if (problems.length > 0) lines.push("", "### What failed, and what could not be read", "", ...problems); + return `${lines.join("\n")}\n`; +} + +function tableRow(result) { + const run = result.run; + const name = result.runId === undefined ? label(result) : `[${label(result)}](${runUrl(result)})`; + const sha = run?.head_sha; + const commit = sha === undefined ? "-" : `[${sha.slice(0, 9)}](https://github.com/${OWNER}/${result.workflow.repo}/commit/${sha})`; + const minutes = + run?.status === "completed" ? String(Math.round((Date.parse(run.updated_at) - Date.parse(run.run_started_at)) / 60_000)) : "-"; + return `| ${name} | ${commit} | ${resultText(result)} | ${minutes} | ${countsText(result.jobs)} |`; +} + +function resultText(result) { + if (result.startError !== undefined) return "not started"; + if (result.readError !== undefined) return "unreadable"; + if (result.stillRunning) return "still running"; + if (result.run === undefined) return "-"; + return result.run.status === "completed" ? result.run.conclusion : result.run.status; +} + +function countsText(jobs) { + const counted = jobs.filter((job) => job.counts !== null); + if (counted.length === 0) return "-"; + const sum = (key) => counted.reduce((total, job) => total + job.counts[key], 0); + return `${sum("passed")} / ${sum("failed")} / ${sum("skipped")}`; +} + +function problemLines(result) { + const name = `**${label(result)}**`; + if (result.startError !== undefined) return [`- ${name} could not start: ${result.startError}`]; + const run = `([run](${runUrl(result)}))`; + if (result.readError !== undefined) return [`- ${name} ${run}: its state could not be read: ${result.readError}`]; + if (result.stillRunning) return [`- ${name} ${run} was still running ${DEADLINE_MS / 60_000} minutes after this run started.`]; + const lines = []; + if (result.run.conclusion === "cancelled" && result.workflow.file === "ci.yml") { + lines.push( + `- ${name} ${run} was cancelled. A push to ${BRANCH} cancels a CI run on ${BRANCH} that is still going, and the push's own CI run tests the newer commit.`, + ); + } else if (result.run.conclusion !== "success") { + lines.push(`- ${name} ${run} ended in ${result.run.conclusion}.`); + for (const job of result.jobs.filter((entry) => !["success", "skipped", null].includes(entry.conclusion))) { + lines.push(...failedJobLines(job)); + } + } + if (result.jobsError !== undefined) lines.push(`- ${name} ${run}: its jobs could not be read: ${result.jobsError}`); + for (const job of result.jobs.filter((entry) => entry.logError !== undefined)) { + lines.push(`- ${name}: the log of job [${job.name}](${job.url}) could not be read, so its tests are not counted: ${job.logError}`); + } + return lines; +} + +function failedJobLines(job) { + const head = ` - Job [${job.name}](${job.url}) ended in ${job.conclusion}`; + if (job.failedTests.length === 0) return [`${head}.`]; + const shown = job.failedTests.slice(0, MAX_LISTED_TESTS).map((test) => ` - \`${test.replaceAll("`", "'")}\``); + const left = job.failedTests.length - shown.length; + return [ + `${head}, with ${job.failedTests.length} failed tests:`, + ...shown, + ...(left > 0 ? [` - and ${left} more`] : []), + ]; +} + +async function main() { + const { extras, existing } = parseArguments(process.argv.slice(2)); + const token = process.env.GH_TOKEN ?? ""; + if (token === "") { + throw new Error( + "GH_TOKEN is empty. In GitHub Actions it comes from the repository secret RUNVIL_ALL_TESTS_TOKEN of cppalliance/runvil; for a local run, export a token, such as `GH_TOKEN=$(gh auth token)`.", + ); + } + const { markdown, passed } = await runAllTests({ github: githubClient(token), extras, existing }); + console.log(markdown); + if (process.env.GITHUB_STEP_SUMMARY) await appendFile(process.env.GITHUB_STEP_SUMMARY, markdown); + process.exitCode = passed ? 0 : 1; +} + +// The tests import this file, so the command runs only when Node started +// this file itself. +if (process.argv[1] === import.meta.filename) { + try { + await main(); + } catch (error) { + console.error(`run-all-tests: ${errorText(error)}`); + process.exitCode = 1; + } +} diff --git a/tools/run-all-tests.test.mjs b/tools/run-all-tests.test.mjs new file mode 100644 index 000000000..f826e04a7 --- /dev/null +++ b/tools/run-all-tests.test.mjs @@ -0,0 +1,265 @@ +// Tests of tools/run-all-tests.mjs: node --test tools/run-all-tests.test.mjs +// +// The log lines below are copied from job logs of 2026-12-03, with the +// timestamp GitHub puts before every line and the byte-order mark at the +// start of a log. +import assert from "node:assert/strict"; +import { test } from "node:test"; +import { CI_WORKFLOWS, parseArguments, parseTestCounts, renderSummary, runAllTests } from "./run-all-tests.mjs"; + +const log = (...lines) => `${lines.map((line) => `2026-12-03T14:09:41.0163847Z ${line}`).join("\n")}\n`; + +const NEXTEST_PASS = log( + "##[group]Run cargo nextest run --locked --workspace --all-features", + " Starting 3345 tests across 23 binaries (24 tests skipped)", + " Summary [ 68.199s] 3345 tests run: 3345 passed, 24 skipped", +); + +const FAILED_TESTS = [ + "workshop::bin/runvil-workshop gateway::tests::boot::matching_boot_publication_survives_closure_and_server_teardown", + "workshop::bin/runvil-workshop gateway::tests::boot::closed_boot_publication_cleans_unpublished_owner_then_continues_teardown", + "workshop-server::it chat_gate::files::gate_the_models_shell_call_makes_a_file_the_file_tools_read", + "workshop-server::it chat_gate::files::gate_the_models_file_tool_calls_change_a_file_of_the_run", +]; +const NEXTEST_FAIL = log( + ` FAIL [ 44.132s] ( 24/430) ${FAILED_TESTS[0]}`, + ` FAIL [ 76.572s] ( 32/430) ${FAILED_TESTS[1]}`, + ` FAIL [ 11.037s] (308/430) ${FAILED_TESTS[2]}`, + ` FAIL [ 11.274s] (314/430) ${FAILED_TESTS[3]}`, + " Summary [ 114.222s] 430 tests run: 426 passed (6 slow), 4 failed, 13 skipped", + ` FAIL [ 44.132s] ( 24/430) ${FAILED_TESTS[0]}`, + ` FAIL [ 76.572s] ( 32/430) ${FAILED_TESTS[1]}`, + ` FAIL [ 11.037s] (308/430) ${FAILED_TESTS[2]}`, + ` FAIL [ 11.274s] (314/430) ${FAILED_TESTS[3]}`, +); + +const CARGO_PASS = log( + "test result: ok. 8 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.05s", + "test result: ok. 5 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s", + "test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s", + "test result: ok. 233 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.09s", + "test result: ok. 23 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s", + "test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s", +); + +const TAP_PASS = log( + "ok 1 - rulebooks use Engine, Harness, Host, and Plugin as the root AGENTS.md defines them", + "ok 2 - Engine crates name the caller, never the Host or the Harness's crates and types", + "ok 3 - the root AGENTS.md and the Pack-facing crates' comments never describe Pack activation", + "# tests 3", + "# suites 0", + "# pass 3", + "# fail 0", + "# cancelled 0", + "# skipped 0", + "# todo 0", + "# duration_ms 412.461358", +); + +test("nextest's summary line gives the counts of a passing run", () => { + assert.deepEqual(parseTestCounts(NEXTEST_PASS), { counts: { passed: 3345, failed: 0, skipped: 24 }, failedTests: [] }); +}); + +test("a failing nextest run gives its counts and names each failed test once", () => { + assert.deepEqual(parseTestCounts(NEXTEST_FAIL), { counts: { passed: 426, failed: 4, skipped: 13 }, failedTests: FAILED_TESTS }); +}); + +test("a nextest test that timed out counts as failed", () => { + const { counts, failedTests } = parseTestCounts( + log(" TIMEOUT [ 60.002s] ( 3/9) runvil-engine::it slow::case", " Summary [ 61.000s] 9 tests run: 8 passed, 1 timed out, 2 skipped"), + ); + assert.deepEqual(counts, { passed: 8, failed: 1, skipped: 2 }); + assert.deepEqual(failedTests, ["runvil-engine::it slow::case"]); +}); + +test("cargo test's result lines add up over every test binary", () => { + assert.deepEqual(parseTestCounts(CARGO_PASS), { counts: { passed: 271, failed: 0, skipped: 0 }, failedTests: [] }); +}); + +test("a failing cargo test run names the failed test and counts ignored tests as skipped", () => { + const { counts, failedTests } = parseTestCounts( + log( + "test tools::read::reads_a_file ... ok", + "test tools::glob::keeps_sorted_order ... FAILED", + "test result: FAILED. 1 passed; 1 failed; 2 ignored; 0 measured; 0 filtered out; finished in 0.01s", + ), + ); + assert.deepEqual(counts, { passed: 1, failed: 1, skipped: 2 }); + assert.deepEqual(failedTests, ["tools::glob::keeps_sorted_order"]); +}); + +test("node --test TAP summaries add up, with cancelled as failed and todo as skipped", () => { + const second = log("not ok 2 - the summary lists a failed job", "# pass 4", "# fail 1", "# cancelled 1", "# skipped 2", "# todo 1"); + const { counts, failedTests } = parseTestCounts(TAP_PASS + second); + assert.deepEqual(counts, { passed: 7, failed: 2, skipped: 3 }); + assert.deepEqual(failedTests, ["the summary lists a failed job"]); +}); + +test("node --test's spec format on later Node versions gives the same counts", () => { + const { counts, failedTests } = parseTestCounts(log("✖ a failed Revert All keeps the unsaved edits (138.367043ms)", "ℹ pass 210", "ℹ fail 1")); + assert.deepEqual(counts, { passed: 210, failed: 1, skipped: 0 }); + assert.deepEqual(failedTests, ["a failed Revert All keeps the unsaved edits"]); +}); + +test("a log that runs other checks gives no counts", () => { + assert.deepEqual(parseTestCounts(log("##[group]Run cargo fmt --all --check", "##[endgroup]")), { counts: null, failedTests: [] }); +}); + +test("the command line takes each extra by name and rejects others", () => { + assert.deepEqual(parseArguments(["--extra", "installers", "--extra", "bundle"]), { extras: ["installers", "bundle"], existing: false }); + assert.deepEqual(parseArguments(["--existing"]), { extras: [], existing: true }); + assert.throws(() => parseArguments(["--extra", "miri"]), { message: "unknown --extra miri; the extras are stt-miri, installers, bundle" }); +}); + +function completedRun(id, conclusion) { + return { + id, + status: "completed", + conclusion, + head_sha: "af9eb141d0123456789", + run_started_at: "2026-12-03T14:08:28Z", + updated_at: "2026-12-03T14:11:12Z", + }; +} + +test("the summary gives one row per workflow and lists what failed", () => { + const job = (name, conclusion, counts, failedTests = []) => ({ name, url: `https://example.test/${name}`, conclusion, counts, failedTests }); + const results = [ + { workflow: CI_WORKFLOWS[1], runId: 11, run: completedRun(11, "success"), jobs: [job("test", "success", { passed: 3345, failed: 0, skipped: 24 }), job("fmt", "success", null)] }, + { + workflow: CI_WORKFLOWS[2], + runId: 12, + run: completedRun(12, "failure"), + jobs: [job("check-workshop", "failure", { passed: 426, failed: 25, skipped: 13 }, Array.from({ length: 25 }, (_, i) => `t${i}`))], + }, + { workflow: CI_WORKFLOWS[5], jobs: [], startError: "HTTP 422: Workflow does not have 'workflow_dispatch' trigger" }, + ]; + const markdown = renderSummary(results); + assert.match(markdown, /^## All tests: 1 of 3 runs passed$/m); + assert.ok( + markdown.includes( + "| [runvil-harness CI](https://github.com/cppalliance/runvil-harness/actions/runs/11) | [af9eb141d](https://github.com/cppalliance/runvil-harness/commit/af9eb141d0123456789) | success | 3 | 3345 / 0 / 24 |", + ), + ); + assert.ok(markdown.includes("| runvil-plugin-api CI | - | not started | - | - |")); + assert.ok(markdown.includes(" - Job [check-workshop](https://example.test/check-workshop) ended in failure, with 25 failed tests:")); + assert.ok(markdown.includes(" - `t19`\n - and 5 more")); + assert.ok(!markdown.includes("`t20`")); + assert.ok(markdown.includes("- **runvil-plugin-api CI** could not start: HTTP 422: Workflow does not have 'workflow_dispatch' trigger")); +}); + +// A stand-in for GitHub's REST API. Each run is in progress for the first +// two reads of its state and then finishes; runvil-plugin-std's CI cannot be +// dispatched, runvil-workshop's fails, and runvil-harness has 101 jobs, two +// pages. +function fakeGitHub() { + const calls = []; + const reads = new Map(); + const repoOf = (id) => CI_WORKFLOWS[id - 1].repo; + const github = { + async call(method, path, body) { + calls.push(`${method} ${path}`); + let match; + if ((match = /^\/repos\/cppalliance\/([\w-]+)\/actions\/workflows\/ci\.yml\/dispatches$/.exec(path))) { + assert.deepEqual(body, { ref: "master", return_run_details: true }); + if (match[1] === "runvil-plugin-std") return { status: 422, data: { message: "Workflow does not have 'workflow_dispatch' trigger" } }; + const id = CI_WORKFLOWS.findIndex((workflow) => workflow.repo === match[1]) + 1; + return { status: 200, data: { workflow_run_id: id, run_url: "", html_url: "" } }; + } + if ((match = /^\/repos\/cppalliance\/[\w-]+\/actions\/runs\/(\d+)$/.exec(path))) { + const id = Number(match[1]); + reads.set(id, (reads.get(id) ?? 0) + 1); + if (reads.get(id) <= 2) return { status: 200, data: { id, status: "in_progress", conclusion: null } }; + return { status: 200, data: completedRun(id, repoOf(id) === "runvil-workshop" ? "failure" : "success") }; + } + if ((match = /^\/repos\/cppalliance\/[\w-]+\/actions\/runs\/(\d+)\/jobs\?filter=latest&per_page=100&page=(\d+)$/.exec(path))) { + const id = Number(match[1]); + const page = Number(match[2]); + const count = repoOf(id) === "runvil-harness" ? (page === 1 ? 100 : 1) : page === 1 ? 2 : 0; + const failing = repoOf(id) === "runvil-workshop"; + const jobs = Array.from({ length: count }, (_, i) => ({ + id: id * 1000 + (page - 1) * 100 + i, + name: i === 0 ? "test" : `job ${i}`, + html_url: `https://example.test/jobs/${id}/${i}`, + conclusion: failing && i === 0 ? "failure" : "success", + })); + return { status: 200, data: { jobs } }; + } + if ((match = /^\/repos\/cppalliance\/[\w-]+\/actions\/jobs\/(\d+)\/logs$/.exec(path))) { + return { status: 302, data: undefined, location: `https://logs.example.test/${match[1]}` }; + } + throw new Error(`the stand-in GitHub was asked for ${method} ${path}`); + }, + async download(url) { + const jobId = Number(url.split("/").pop()); + if (repoOf(Math.floor(jobId / 1000)) === "runvil-workshop" && jobId % 1000 === 0) return NEXTEST_FAIL; + return jobId % 1000 === 0 ? NEXTEST_PASS : log("##[group]Run cargo fmt --all --check"); + }, + }; + return { github, calls }; +} + +test("runAllTests dispatches every CI workflow, waits for the runs, and summarizes them", async () => { + const { github, calls } = fakeGitHub(); + let sleeps = 0; + const progress = []; + const { markdown, passed } = await runAllTests({ + github, + now: () => 0, + sleep: async () => { + sleeps += 1; + }, + log: (line) => progress.push(line), + }); + assert.equal(passed, false); + assert.equal(sleeps, 2); + assert.equal(calls.filter((call) => call.startsWith("POST ")).length, 9); + assert.match(markdown, /^## All tests: 7 of 9 runs passed$/m); + assert.ok(markdown.includes("| runvil-plugin-std CI | - | not started | - | - |")); + assert.ok(markdown.includes("| [runvil-harness CI](https://github.com/cppalliance/runvil-harness/actions/runs/2) |")); + assert.ok(markdown.includes("| success | 3 | 3345 / 0 / 24 |")); + assert.ok(markdown.includes("| failure | 3 | 426 / 4 / 13 |")); + assert.ok(markdown.includes(` - \`${FAILED_TESTS[3]}\``)); + assert.ok(markdown.includes("- **runvil-plugin-std CI** could not start: HTTP 422: Workflow does not have 'workflow_dispatch' trigger")); + assert.ok(calls.includes("GET /repos/cppalliance/runvil-harness/actions/runs/2/jobs?filter=latest&per_page=100&page=2")); + assert.ok(progress.some((line) => line.startsWith("waiting for 8 runs: runvil CI (in_progress)"))); +}); + +test("a run that is still going at the deadline is reported as still running", async () => { + const github = { + async call(method, path) { + if (method === "POST") return { status: 200, data: { workflow_run_id: 7 } }; + if (path.endsWith("/runs/7")) return { status: 200, data: { id: 7, status: "in_progress", conclusion: null } }; + throw new Error(`unexpected ${method} ${path}`); + }, + }; + let clock = 0; + const { markdown, passed } = await runAllTests({ + github, + now: () => clock, + sleep: async (ms) => { + clock += ms; + }, + log: () => {}, + }); + assert.equal(passed, false); + assert.ok(markdown.includes("| still running | - | - |")); + assert.ok(markdown.includes("was still running 170 minutes after this run started.")); +}); + +test("--existing reads the newest finished run of each workflow and starts nothing", async () => { + const calls = []; + const github = { + async call(method, path) { + calls.push(`${method} ${path}`); + if (path.includes("/workflows/ci.yml/runs?branch=master&status=completed&per_page=1")) return { status: 200, data: { workflow_runs: [{ id: 5 }] } }; + if (path.endsWith("/runs/5")) return { status: 200, data: completedRun(5, "success") }; + if (path.includes("/runs/5/jobs?")) return { status: 200, data: { jobs: [] } }; + throw new Error(`unexpected ${method} ${path}`); + }, + }; + const { markdown, passed } = await runAllTests({ github, existing: true, now: () => 0, sleep: async () => {}, log: () => {} }); + assert.equal(passed, true); + assert.equal(calls.filter((call) => call.startsWith("POST ")).length, 0); + assert.match(markdown, /^## Newest finished runs on master: 9 of 9 runs passed$/m); +}); From 224d39d0cd5509c9fb35ae3297901e415656f075 Mon Sep 17 00:00:00 2001 From: Andrew Rogers <87336074+rogers-andrew@users.noreply.github.com> Date: Thu, 3 Dec 2026 11:11:33 -0800 Subject: [PATCH 3/4] Record the local checks of the All tests workflow The script's 13 tests pass, and two deliberately broken copies of it each fail one. A read-only run with --existing read the newest finished master run of the nine CI workflows, about 80 jobs, in 55 seconds and reported all nine passed, with per-job counts that match each job's log: runvil-harness job test 3345 passed and 24 skipped, runvil-workshop job check-workshop 436 passed and 9 skipped, runvil-plugin-api 271 passed in each of its three test jobs. Both workflow files parse, and the shell step turns the ticked boxes into the right --extra arguments. actionlint has not run, and neither has a real dispatch to confirm the fields of GitHub's reply. The plan keeps both as open checks. The plan now matches the code where it had drifted: the run's own token gets contents: read for the checkout, the script downloads a job log from its redirect address without the token, jobs are read 100 to a page until a short page, and an expired token shows every workflow as not started with 401. Plan: /vibe/2026-12-03-1-run-all-tests-workflow.md Co-Authored-By: Claude Opus 5.5 --- vibe/2026-12-03-1-run-all-tests-workflow.md | 143 +++++++++++--------- 1 file changed, 80 insertions(+), 63 deletions(-) diff --git a/vibe/2026-12-03-1-run-all-tests-workflow.md b/vibe/2026-12-03-1-run-all-tests-workflow.md index 977c6f5eb..054bd17e9 100644 --- a/vibe/2026-12-03-1-run-all-tests-workflow.md +++ b/vibe/2026-12-03-1-run-all-tests-workflow.md @@ -4,18 +4,24 @@ overview: A new workflow in cppalliance/runvil, All tests, starts the CI workflo todos: - id: plan-copy content: "Commit this plan alone on the branch run-all-tests" - status: pending + status: completed - id: script content: "Add tools/run-all-tests.mjs and tools/run-all-tests.test.mjs, the scripts job in ci.yml, all-tests.yml, and workflow_dispatch in runvil's ci.yml" - status: pending + status: completed - id: local - content: "Run the unit tests, a read-only --existing run against today's master runs, actionlint, docs-claims, and vibelight" + content: "Run the unit tests, a read-only --existing run against the master runs of 2026-12-03, the YAML parse and shell-step checks, and docs-claims, and record the results" + status: completed + - id: open-checks + content: "Run actionlint on all-tests.yml and ci.yml, and with Andrew's yes the gh api dispatch of runvil-cloud-providers' CI" status: pending - - id: one-line-prs - content: "With Andrew's yes, fork the four Plugin repos and add workflow_dispatch to ci.yml in runvil-harness, runvil-workshop, and the four Plugin repos, one branch and one PR each" + - id: one-line-commits + content: "Fork the four Plugin repos, and commit workflow_dispatch in ci.yml on a branch run-all-tests in runvil-harness, runvil-workshop, and the four Plugin repos" + status: in_progress + - id: prs + content: "With Andrew's yes, push the seven branches to his forks and open the seven pull requests" status: pending - id: token - content: "After the runvil PR merges, an admin creates the token and stores it as RUNVIL_ALL_TESTS_TOKEN in cppalliance/runvil" + content: "After the runvil PR merges, an admin stores a token as RUNVIL_ALL_TESTS_TOKEN in cppalliance/runvil" status: pending - id: first-run content: "Click Run workflow and record the result in this plan" @@ -29,40 +35,41 @@ This plan uses these terms: - **CI workflow**: `.github/workflows/ci.yml` in a Runvil repo. GitHub runs it on every push to `master` and on every pull request, and its `ci-green` job is the check that branch protection requires. - **The nine repos**: the Runvil repos that hold code and a CI workflow: `runvil`, `runvil-harness`, `runvil-workshop`, `runvil-gateway`, `runvil-cloud-providers`, `runvil-plugin-api`, `runvil-plugin-bashkit`, `runvil-plugin-std`, and `runvil-plugin-web`, all owned by `cppalliance`. `runvil-classroom`, `runvil-design`, and `runvil-docs` hold only prose. +- **All tests**: the new workflow `.github/workflows/all-tests.yml` in `cppalliance/runvil`, and the name GitHub shows for it on the repo's Actions tab. An All tests run is one start of it. - **Dispatch**: starting a workflow by hand, with the Run workflow button on its Actions page or with the REST call `POST /repos/{owner}/{repo}/actions/workflows/{file}/dispatches`. GitHub accepts a dispatch only for a workflow whose `on:` block lists `workflow_dispatch`. -- **Extras**: three test workflows that take longer than CI and accept a dispatch already. STT Miri (`runvil-gateway/.github/workflows/stt-miri.yml`, up to about 31 minutes) checks the Gateway's speech-to-text code under Miri, Rust's interpreter that detects undefined behavior. Installers (`runvil/.github/workflows/installers.yml`, about 20 minutes) builds the five installers and installs them on five kinds of machine. Bundle (`runvil-workshop/.github/workflows/bundle.yml`, about 18 minutes) builds Workshop's signed bundles. A dispatched Installers run keeps its installers as workflow artifacts for 7 days and publishes a release only for a pushed `vX.Y.Z` tag. Bundle keeps its bundles as workflow artifacts, and the Installers workflow publishes releases. -- **The token**: a GitHub token stored as the repository secret `RUNVIL_ALL_TESTS_TOKEN` in `cppalliance/runvil`. The token GitHub gives each workflow run can act only on the repo it runs in, so starting and reading runs in the other eight repos needs this second token. +- **Extras**: three test workflows that take longer than CI and accept a dispatch already. STT Miri (`runvil-gateway/.github/workflows/stt-miri.yml`, up to about 31 minutes) checks the Gateway's speech-to-text code under Miri, Rust's interpreter that detects undefined behavior. Installers (`runvil/.github/workflows/installers.yml`, about 20 minutes) builds the five installers and installs them on five kinds of machine; a dispatched Installers run keeps the installers as workflow artifacts for 7 days, and Installers publishes a release only when a pushed `vX.Y.Z` tag starts it. Bundle (`runvil-workshop/.github/workflows/bundle.yml`, about 18 minutes) builds Workshop's signed bundles and keeps them as workflow artifacts; it never publishes. +- **The token**: a fine-grained GitHub token, one limited to chosen repos and permissions, stored as the repository secret `RUNVIL_ALL_TESTS_TOKEN` in `cppalliance/runvil`. The token GitHub gives each workflow run can act only on the repo it runs in, so starting and reading runs in the other eight repos needs this second token. - **Test counts**: the number of tests passed, failed, and skipped, read from the text each test runner prints in a job's log. ## Product Requirements -Each of the nine repos tests itself on every push to `master`, so "does every Runvil test pass" today means opening nine Actions pages, or building and running all nine suites on one machine. On 2026-12-03 a local run of all nine suites on Andrew's 8-core machine kept the load average near 17 and filled the disk to 6.4 GB free. All tests moves that work to GitHub's runners and puts the answer on one page. +Each of the nine repos tests itself on every push to `master`, so finding out whether every Runvil test passes today means opening nine Actions pages, or building and running all nine suites on one machine. On 2026-12-03 a local run of the suites on Andrew's 8-core machine kept the load average near 17 and took the machine's home disk from 36 GB free to 6.4 GB free. All tests starts the nine CI workflows on GitHub's runners and shows every result on one page. - Problem and users: - - Andrew owns Runvil's CI; Vinnie Falco assigned it to him in class 8 on 2026-11-19. Anyone with write access to `cppalliance/runvil` can use the button. + - Andrew is responsible for Runvil's CI; Vinnie Falco gave him that job on 2026-11-19. Everyone with write access to `cppalliance/runvil` can start All tests, and anyone who can open the repo's Actions tab can read its summary. - A person who wants to know whether every test passes on `master` now has nine pages to read, and the extras run only when someone starts each one. - Goals: - One Run workflow button, on the All tests page of `cppalliance/runvil`'s Actions tab, dispatches the CI workflow of each of the nine repos on `master`. - Three checkboxes on the same form, unticked by default, add STT Miri, Installers, and Bundle. - When every run has finished, the All tests run's Summary page shows each run's result, commit, duration, and test counts, and lists every failed job and failed test with links. - Non-goals: - - Changing what any CI workflow or extra tests. + - Changing what any CI workflow or extra workflow tests. - Testing a branch other than `master`, or a pull request. - Success criteria: - - A click with the boxes unticked ends in about the time of the slowest CI run (Gateway CI took 12 to 13 minutes on 2026-11-30) plus up to one minute. - - The All tests run ends green exactly when every run it started ends in success. + - A click with the boxes unticked ends in about the time of the slowest CI run (Gateway CI took 12 to 13 minutes on 2026-11-30) plus up to three minutes: up to one for the last minute's read of the runs, and the rest to set up the job and read the job logs (the read-only run of 2026-12-03 read about 80 logs in 55 seconds). + - The All tests run ends green exactly when every selected workflow started and its run ended in success. - The test counts of a run match the counts its own job logs print. - Constraints: - - Andrew's access on all nine repos is write, one level below admin (checked 2026-12-03 with `gh api repos/cppalliance/`). GitHub lets only admins add repository secrets, so an admin creates the token and the secret. - - The script runs on Node 22 with the standard library only, like `tools/docs-claims.mjs`, so the job runs it straight after checking out the repo and setting up Node. + - Andrew's access on all nine repos is write, one level below admin (checked 2026-12-03 with `gh api repos/cppalliance/`). GitHub lets only admins add repository secrets, so an admin adds the secret. The token in it can belong to anyone with write access to all nine repos, Andrew included, and the admin chooses whose. + - The script that All tests runs, `tools/run-all-tests.mjs`, needs Node 22 or later and its standard library only, like `tools/docs-claims.mjs`, so the workflow's one job runs it straight after checking out the repo and setting up Node. - Each CI workflow puts its runs in the concurrency group `${{ github.workflow }}-${{ github.ref }}` with `cancel-in-progress: true`, so a dispatched run on `master` and a push to `master` share one group, and a push during the All tests run cancels the dispatched run. - Open questions: None ## Functional Specification -A person clicks Run workflow, ticks the extras they want, and confirms. One job dispatches every selected workflow on `master`, waits until all of them finish, reads their jobs and job logs, and writes the summary. The job fails when any started run fails, is cancelled, or could not start. +A person clicks Run workflow, ticks the extras they want, and confirms. One job dispatches every selected workflow on `master`, waits until all of them finish, reads their jobs and job logs, and writes the summary. The All tests run fails when GitHub refuses to start at least one selected workflow, or when at least one run it started ends in anything other than success. - Actors and workflows: - A person with write access to `cppalliance/runvil` starts All tests from the Actions tab. GitHub lets only such people dispatch a workflow. @@ -71,83 +78,87 @@ A person clicks Run workflow, ticks the extras they want, and confirms. One job - Inputs and outputs: - Inputs: the booleans `stt-miri`, `installers`, and `bundle`, and the token in `GH_TOKEN`. - The script writes the summary to the file `$GITHUB_STEP_SUMMARY` names, which GitHub shows on the run's Summary page, and prints the same Markdown to the job log. Run outside Actions, it prints only. - - The summary opens with one line giving how many runs passed out of how many started. + - The summary opens with one line giving how many runs passed out of how many workflows were selected. - A table follows, one row per workflow. Its columns are the run (repo and workflow, linked to the run), the commit (short SHA, linked), the result, the minutes from start to finish, and the test counts as passed, failed, and skipped. - One entry follows for each job that failed, timed out, or was cancelled. It links the job and lists the names of its failed tests, up to 20, then the number left out. - For each workflow GitHub refused to start, an entry gives the HTTP status and GitHub's message. - - A note under the table says that the counts add up every job, so a suite that CI runs on three systems counts three times. + - A note under the table says that the counts add up every job, so a suite that CI runs on three systems counts three times, and that skipped tests include those a job's filter leaves out. For example, the `live` job of `runvil-workshop`'s CI runs 10 tests against a running Gateway, and nextest reports the other 752 tests of the crates it filters as skipped. - States and validation: - Each workflow moves from dispatched to queued, in progress, and completed, or ends as not started when GitHub refuses the dispatch. - - A run's result is GitHub's `conclusion`: `success`, `failure`, `cancelled`, `timed_out`, or another value GitHub reports, shown as GitHub writes it. + - A run's result is GitHub's `conclusion`: `success`, `failure`, `cancelled`, `timed_out`, or another value GitHub reports, shown as GitHub writes it. The script adds three results of its own: `not started` when GitHub refuses the dispatch, `unreadable` after five failed reads of the run in a row, and `still running` at the 170-minute limit. - Test counts come from three line formats. cargo-nextest prints `Summary [...] N tests run: N passed, N failed, N skipped`, with `(N slow)` after passed in some runs. `cargo test` prints one `test result: ok. N passed; N failed; N ignored; ...` line per test binary. `node --test` on Node 22 prints TAP, the Test Anything Protocol, with `# pass N`, `# fail N`, `# skipped N`, `# cancelled N`, and `# todo N` lines per run. Cancelled counts as failed, and ignored and todo count as skipped. - - Failed test names come from nextest's `FAIL`, `TIMEOUT`, and `SIG...` lines, from `cargo test`'s `test ... FAILED` lines, and from TAP's `not ok N - ` lines, each name listed once. - - A job that runs other checks, such as `fmt` or `clippy`, shows its result alone. + - Failed test names come from nextest's `FAIL` and `TIMEOUT` lines and from its lines that start with a signal name such as `SIGSEGV` or `SIGABRT` (a test process killed by that signal), from `cargo test`'s `test ... FAILED` lines, and from TAP's `not ok N - ` lines, each name listed once. + - A job such as `fmt` or `clippy`, which prints none of the three formats, adds only its result to the summary. A job that runs tests and other checks adds the counts of its tests. - The script stops waiting 170 minutes after it starts; runs still going then are reported as still running and fail the All tests run. The job's own limit is 180 minutes. - Errors and recovery: - When `GH_TOKEN` is empty, the script fails at once with a message that names the secret `RUNVIL_ALL_TESTS_TOKEN` and the repo it belongs in. - - When GitHub refuses a dispatch (422 when the workflow's `on:` block lacks `workflow_dispatch`, 403 or 404 when the token cannot reach the repo), that workflow is reported as not started and the others go on. - - A failed read of a run's state or jobs (a network error or a 5xx status) is retried on the next minute's round, up to five times in a row for one run, then that run is reported with the last error. - - When a job's log cannot be downloaded, that job shows its result alone and the error is listed; the run's result still comes from GitHub. + - When GitHub refuses a dispatch, that workflow is reported as not started with the HTTP status and GitHub's message, and the others go on. GitHub answers 422 when the workflow's `on:` block lacks `workflow_dispatch`, 401 when the token has expired or been revoked, and 403 or 404 when the token cannot reach the repo. + - A failed read of a run's state (a network error, or any status other than 200, such as a 5xx or a 401 from a token that expired during the run) is retried on the next minute's round. After five failures in a row for one run, its result reads `unreadable`, the summary gives the last error, and the All tests run fails. A failed read of a run's jobs is listed with its error, and the run's result still comes from GitHub. + - When a job's log cannot be downloaded, the job adds its result without counts, and the summary lists the error. - A cancelled CI run on `master` is listed with the reason most likely for it: a push to `master` cancels a dispatched CI run, and the newer push's own run tests the newer commit. - Cancelling the All tests run leaves the runs it started running in their own repos. - Security and privacy behavior: - - The token reaches the script only through the `GH_TOKEN` environment variable of its step, and GitHub masks secrets in logs. For a failed request the script prints the method, the address, the status, and GitHub's message, and never the request headers. - - The workflow sets `permissions: {}` for the run's own token, because the script uses only the secret. + - The token reaches the script only through the `GH_TOKEN` environment variable of its step, and GitHub masks secrets in logs. For a failed request the summary gives the HTTP status and GitHub's message, and the script never prints request headers. + - The workflow gives the run's own token only `contents: read`, which the checkout needs; the script acts with the secret alone. - The nine repos are public, so the summary shows only results and logs that anyone can read already. - Acceptance criteria: - With the boxes unticked, the summary lists nine CI runs, and the All tests run passes when all nine pass. - - Before the six one-line pull requests merge, the six workflows whose `on:` block lacks `workflow_dispatch` appear as not started with GitHub's 422 message, and the run fails. - - The counts for today's `master` runs match their logs: `runvil-harness` job `test` 3345 passed and 24 skipped, `runvil-workshop` job `check-workshop` 436 passed and 9 skipped, `runvil-plugin-api` job `test (ubuntu-latest)` 271 passed. + - Before the six one-line pull requests (in `runvil-harness`, `runvil-workshop`, and the four `runvil-plugin-*` repos) merge, those six CI workflows appear as not started with GitHub's 422 message, and the All tests run fails. + - The counts for the `master` runs of 2026-12-03 match their logs: `runvil-harness` job `test` 3345 passed and 24 skipped, `runvil-workshop` job `check-workshop` 436 passed and 9 skipped, `runvil-plugin-api` job `test (ubuntu-latest)` 271 passed. ## Technical Design -A new dispatch-only workflow in `cppalliance/runvil` runs a Node script that drives the GitHub REST API with `fetch`. The script's line parsers and summary writer are plain functions that its tests import. The other repos change by one line each in their CI workflow. +A new dispatch-only workflow in `cppalliance/runvil` runs a Node script that drives the GitHub REST API with `fetch`. The script's line parser, summary writer, and main loop are exported functions that its tests import, with GitHub and the clock replaced by stand-ins. Six other repos change by one line each in their CI workflow. - Architecture: - - `.github/workflows/all-tests.yml`: `on: workflow_dispatch` with the three boolean inputs; `concurrency: { group: all-tests, cancel-in-progress: false }`, so a second click waits for the first run; `permissions: {}`; one job on `ubuntu-latest` with `timeout-minutes: 180` that checks out the repo, sets up Node 22, and runs the script with `GH_TOKEN: ${{ secrets.RUNVIL_ALL_TESTS_TOKEN }}`. - - The script calls four endpoints, all under `https://api.github.com/repos/cppalliance//actions`. + - `.github/workflows/all-tests.yml`: `on: workflow_dispatch` with the three boolean inputs; `concurrency: { group: all-tests, cancel-in-progress: false }`, so a second click waits for the first run; `permissions: { contents: read }`; one job on `ubuntu-latest` with `timeout-minutes: 180` that checks out the repo, sets up Node 22, and runs the script with `GH_TOKEN: ${{ secrets.RUNVIL_ALL_TESTS_TOKEN }}`. + - A normal run calls four endpoints, all under `https://api.github.com/repos/cppalliance//actions`. - `POST /workflows//dispatches` with `{"ref": "master", "return_run_details": true}` returns 200 with `workflow_run_id`, `run_url`, and `html_url`. - `GET /runs/` gives the run's `status`, `conclusion`, `head_sha`, `run_started_at`, and `updated_at`. - - `GET /runs//jobs?filter=latest&per_page=100` gives the jobs, page by page through the `Link` header. - - `GET /jobs//logs` answers 302 with a download address that is valid for one minute; `fetch` follows it and drops the `Authorization` header when it leaves `api.github.com`. - - Each request sends `Accept: application/vnd.github+json`, `X-GitHub-Api-Version: 2022-11-28`, and a 30-second timeout. + - `GET /runs//jobs?filter=latest&per_page=100&page=` gives the jobs, 100 at a time; the script asks for the next page until one holds fewer than 100. + - `GET /jobs//logs` answers 302 with a download address that is valid for one minute. The script reads that address from the reply and downloads the log with a second request that omits the token, because the address points at storage outside GitHub's API. + - Each API request sends `Accept: application/vnd.github+json` and `X-GitHub-Api-Version: 2022-11-28`, and every request gives up after 30 seconds. - Modules and interfaces: - - `tools/run-all-tests.mjs` holds the list of workflows (the nine CI workflows and the three extras) and exports `parseTestCounts(logText)`, `renderSummary(results)`, and `runAllTests({ request, extras, existing, now, sleep })`. `request` is the function that performs one HTTP call, which the tests replace with a stand-in GitHub. + - `tools/run-all-tests.mjs` holds the list of workflows (the nine CI workflows and the three extras) and exports `parseTestCounts(logText)`, `renderSummary(results)`, `parseArguments(args)`, `githubClient(token)`, and `runAllTests({ github, extras, existing, now, sleep, log })`. + - `github` holds the two functions that talk to GitHub: `call`, one REST call, which answers the status, the parsed JSON body, and a redirect's address; and `download`, one log download. `githubClient(token)` makes the real pair, and the tests pass a stand-in GitHub. `now` and `sleep` read the clock and wait a minute between rounds; the tests replace them so that a test of the 170-minute limit runs at once. `log` prints the progress lines. - The file runs its command-line entry only when it is the program Node started, so the tests can import it. - - `--existing` replaces each dispatch with a read of the workflow's newest completed run on `master` (`GET /workflows//runs?branch=master&status=completed&per_page=1`). It only reads, and it is how a person checks the summary against runs that have already finished. + - `--existing` replaces each dispatch with a read of the workflow's newest completed run on `master`, a fifth endpoint (`GET /workflows//runs?branch=master&status=completed&per_page=1`). It only reads, and it is how a person checks the summary against runs that have already finished. - `tools/run-all-tests.test.mjs` holds the tests (`node:test`). - File and public API changes: - `cppalliance/runvil`: add `.github/workflows/all-tests.yml`, `tools/run-all-tests.mjs`, and `tools/run-all-tests.test.mjs`; in `.github/workflows/ci.yml` add `workflow_dispatch:` to `on:`, add a job `scripts` that runs `node --test tools/run-all-tests.test.mjs` on Node 22, and add `scripts` to the `needs:` list of `ci-green`. - - `runvil-harness`, `runvil-workshop`, `runvil-plugin-api`, `runvil-plugin-bashkit`, `runvil-plugin-std`, and `runvil-plugin-web`: add `workflow_dispatch:` under `on:` in `.github/workflows/ci.yml`. `runvil-gateway` and `runvil-cloud-providers` list it already. + - `runvil-harness`, `runvil-workshop`, `runvil-plugin-api`, `runvil-plugin-bashkit`, `runvil-plugin-std`, and `runvil-plugin-web`: add `workflow_dispatch:` under `on:` in `.github/workflows/ci.yml`. The CI workflows of `runvil-gateway` and `runvil-cloud-providers` list it already. - Data, persistence, failure, security, and privacy constraints: - The script keeps its state in memory for one run, and each run starts from the workflow list in its source. - - The token needs, on each of the nine repos, the fine-grained permission Actions: Read and write (dispatch needs write, and reading runs, jobs, and logs needs read). Its owner must have write access to all nine repos. - - Request volume: twelve runs read once a minute for at most 170 minutes is about 2,000 requests, plus about two per job for logs, which stays under the 5,000 requests an hour GitHub allows one token. + - The token needs Actions: Read and write on each of the nine repos: dispatch needs write, and reading runs, jobs, and logs needs read. GitHub's REST pages name only the classic `repo` scope for these calls, so the first real click confirms the fine-grained permission. An organization can require an owner to approve each fine-grained token used on its repos; whether `cppalliance` does is unknown, and if it does, an owner approves the token before the admin adds the secret. + - Request volume: reading twelve runs once a minute is 720 requests an hour, at most about 2,040 in the 170 minutes. Each job's log takes two requests, one for the download address and one for the log, about 200 for a run without extras. GitHub allows one token 5,000 requests an hour. ## Testing Plan -Unit tests cover the three log formats and the summary, using lines copied from real job logs. A test with a stand-in GitHub drives the whole flow. A read-only run against the real runs of 2026-12-03 checks the counts, and the first click after merge checks the real dispatch. +Unit tests cover the three log formats and the summary, using lines copied from job logs. A test with a stand-in GitHub drives the whole flow. A read-only run against the real runs of 2026-12-03 checks the counts, and the first click after merge checks the real dispatch. - Unit: - - `parseTestCounts` on excerpts of today's logs: nextest from `runvil-harness` job `test` (3345 passed, 24 skipped) and a failing nextest summary (`430 tests run: 426 passed (6 slow), 4 failed, 13 skipped` with four `FAIL` lines, each name listed twice in the log); `cargo test` from `runvil-plugin-api` (six `test result:` lines adding to 271 passed); TAP from `runvil-harness` job `wording` (3 passed), and a TAP block with a `not ok` line. Each excerpt keeps the timestamp GitHub puts before every line and the byte-order mark at the start of a log. + - `parseTestCounts` on excerpts of job logs of 2026-12-03: nextest from `runvil-harness` job `test` (3345 passed, 24 skipped); a failing nextest run (`430 tests run: 426 passed (6 slow), 4 failed, 13 skipped`, with four `FAIL` lines, each name printed twice), taken from a local Linux run that day of the tests of Workshop's crates `workshop`, `workshop-server`, and `workshop-server-api`; `cargo test` from `runvil-plugin-api` (six `test result:` lines adding to 271 passed); TAP from `runvil-harness` job `wording` (3 passed), and a TAP block with a `not ok` line. Each excerpt has the timestamp GitHub puts before every line and the byte-order mark at the start of a log. - `renderSummary`: the counts line, a row with a failed job and its test names, a not-started workflow with its message, and the cap at 20 names. + - `parseArguments`: each extra by name, `--existing`, and an unknown extra refused with the list of extras. - Integration and end-to-end: - - `runAllTests` against a stand-in GitHub: one dispatch answered 200, one refused with 422, a run that goes from queued to completed over three rounds, two pages of jobs, and job logs. The test checks the summary and that the run counts as failed. - - A read-only local run, `GH_TOKEN=$(gh auth token) node tools/run-all-tests.mjs --existing`, against the `master` runs of 2026-12-03, compared with the counts under Acceptance criteria. - - One `gh api` dispatch of `runvil-cloud-providers`'s CI (about one minute; it accepts dispatches already) with `return_run_details: true`, to confirm the response fields, only with Andrew's yes because it starts a run under his name. + - `runAllTests` against a stand-in GitHub: one dispatch answered 200, one refused with 422, runs that go from in progress to completed over three rounds, two pages of jobs, and job logs. The test checks the summary and that `runAllTests` reports the All tests run as failed. Two more tests cover a run still going at the 170-minute limit and `--existing`, which must send no dispatch. + - A read-only local run, `GH_TOKEN=$(gh auth token) node tools/run-all-tests.mjs --existing`, against the `master` runs of 2026-12-03, whose per-job counts must match the three counts under Acceptance criteria. + - One `gh api` dispatch of `runvil-cloud-providers`'s CI (about one minute; it accepts dispatches already) with `return_run_details: true`, to confirm the reply's fields. It runs only with Andrew's yes, because it starts a run under his name. - After merge and the secret: one click with the boxes unticked. - Regression, security, and performance: - - `node --test tools/docs-claims.mjs` and `node --test tools/run-all-tests.test.mjs`. - - actionlint on `all-tests.yml` and `ci.yml`. - - vibelight in the repo root. + - `node --test tools/docs-claims.mjs` (this repo's check of how documents use the project's defined terms) and `node --test tools/run-all-tests.test.mjs`. + - actionlint, a linter for GitHub workflow files, on `all-tests.yml` and `ci.yml`. + - Security: `all-tests.yml` grants the run's own token only `contents: read`, and the script's only output is the summary and progress lines, checked by reading the code. + - Performance: the read-only run reads the nine runs and their job logs, about 80, in under 2 minutes. + - vibelight, the team's tool that outlines Rust crates for review, is not run, because this change is JavaScript and YAML. - Exit criteria: - - Every test above passes, the `--existing` counts match, and the first real click produces a summary whose rows match the runs it started. + - The unit and stand-in tests pass, the `--existing` counts match the job logs, actionlint reports no error in either workflow file, the `gh api` dispatch returns `workflow_run_id`, and the first real click produces a summary whose rows match the runs it started. @@ -155,27 +166,32 @@ Unit tests cover the three log formats and the summary, using lines copied from ## Decision Record - Decisions: - - The button and the script live in `cppalliance/runvil`, and an admin stores the token there. The team sees one page, and each CI run happens in its own repo with its own cache, as on a push. Andrew chose "runvil + admin token". - - All tests always starts the nine CI workflows, and the form offers the extras as checkboxes that start unticked. Andrew chose "CI + optional extras". - - The summary shows job results and test counts read from job logs, with failed test names. Andrew chose "Jobs, plus test counts", accepting that a change in a test runner's output format can stop the counts until the parser follows it. - - Andrew's fork of each of the four Plugin repos (`runvil-plugin-api`, `runvil-plugin-bashkit`, `runvil-plugin-std`, `runvil-plugin-web`) is created for their pull requests. Andrew chose "Create the four forks". - - The script reads the run ID from the dispatch response, using `return_run_details`, which GitHub added on 2026-02-19. Matching runs by start time could pick a push run that started in the same minute. + - The button and the script live in `cppalliance/runvil`, and an admin stores the token there. Everyone who can open that repo's Actions tab can read the summary, and each CI run happens in its own repo with its own cache, as on a push. On 2026-12-03 Andrew chose this from three options: this one, a repo of his own with his personal token, and one combined run that calls every CI workflow from `runvil`. + - All tests always starts the nine CI workflows, and the form offers the extras as checkboxes that start unticked. Andrew chose this over starting the nine CI workflows alone. + - The summary shows job results and test counts read from job logs, with failed test names. Andrew chose this over job results alone, accepting that a change in a test runner's output format can stop the counts until the parser follows it. + - Changes reach `cppalliance` repos as pull requests from a person's fork. Andrew has forks of `runvil`, `runvil-harness`, `runvil-workshop`, and `runvil-gateway`, and on 2026-12-03 he agreed to fork `runvil-plugin-api`, `runvil-plugin-bashkit`, `runvil-plugin-std`, and `runvil-plugin-web` for their one-line pull requests. GitHub makes a fork of a public repo public, and each of these forks holds only its one-line branch. + - The script reads the run ID from the dispatch reply, using `return_run_details`, which GitHub added on 2026-02-19. Matching runs by start time could pick a push run that started in the same minute. - Rejected alternatives: - One combined run in which `runvil`'s workflow calls each CI workflow as a reusable workflow. It works with the run's own token, but each called workflow checks out the calling repo, so every checkout step in all nine CI workflows would need a repository argument, and all nine repos' caches would share `runvil`'s 10 GB cache limit and evict `runvil`'s own. Revisit if the token cannot be had. - - A repo of Andrew's own holding his personal token. Only he would see the button, and runs would start under his name. Revisit if an admin cannot create the token. + - A repo of Andrew's own holding his personal token. Only he would see the button, and runs would start under his name. Revisit if an admin cannot add the secret. - Re-running each repo's last `master` run through the re-run API. It works with the CI workflows as they are, but GitHub re-runs only runs younger than 30 days, and the re-run replaces the original run's results as its second attempt. - Running every suite on a developer's machine, which loaded the machine and filled its disk on 2026-12-03. - Assumptions, risks, and notes: - - Assumption: Actions: Read and write is the fine-grained permission that dispatch, runs, jobs, and logs need. GitHub's REST pages name only the classic `repo` scope. The first real click confirms it. - - Assumption: the `cppalliance` organization allows fine-grained tokens on its repos. An organization can require an owner to approve each one. - - Risk: a fine-grained token expires on the date its creator sets, and the All tests run then fails at its first dispatch with 401. A GitHub App owned by the organization avoids expiry, at the cost of an app ID and private key as two secrets and a step that mints a token. - - Risk: a push to `master` during a run cancels that repo's dispatched CI run, and the summary reports it cancelled. - - Note: CI tests Workshop's crates `workshop`, `workshop-server`, and `workshop-server-api` on Windows only; on Linux it only builds them. A local Linux run on 2026-12-03 had 4 failures among their 430 tests while the machine was heavily loaded. All tests reports what CI runs and leaves this gap as it is. + - Risk: a fine-grained token expires on the date its creator sets, and from then on every workflow of an All tests run is reported as not started with 401. The admin who adds the secret sets the expiry date and renews the token before it. A GitHub App owned by the organization avoids expiry, at the cost of an app ID and private key as two secrets and a step that mints a token. + - Note: CI tests Workshop's crates `workshop`, `workshop-server`, and `workshop-server-api` on Windows only; on Linux it only builds them. A local Linux run on 2026-12-03 had 4 failures among their 430 tests while the machine was heavily loaded. + - Result of the local checks on 2026-12-03, on Andrew's machine: + - `node --test tools/run-all-tests.test.mjs`: 13 passed. Two deliberately broken copies of the script, one that dropped ignored tests from the `cargo test` counts and one that read only the first page of jobs, each failed one test. + - `GH_TOKEN=$(gh auth token) node tools/run-all-tests.mjs --existing` read the newest finished `master` run of the nine CI workflows, about 80 jobs, in 55 seconds and reported 9 of 9 passed. The per-job counts match each job's log: `runvil-harness` job `test` 3345 passed and 24 skipped, `runvil-workshop` job `check-workshop` 436 passed and 9 skipped, and `runvil-plugin-api` 271 passed in each of its three test jobs. Each Plugin repo's total is three times its single-system count, because its CI tests on three systems: `runvil-plugin-api` 813, `runvil-plugin-std` 1536, `runvil-plugin-bashkit` 270, and `runvil-plugin-web` 501. + - `node --test tools/docs-claims.mjs`: 2 passed. + - Both workflow files parse as YAML, `ci-green` lists the new `scripts` job, and the shell step of `all-tests.yml`, run with `node` replaced by `echo`, passes `--extra stt-miri --extra bundle` for those two boxes and no argument when every box is unticked. + - actionlint was not run: the permission check of Claude Code, the coding agent that ran these checks, refused to download and run its release binary. + - The `gh api` dispatch check has not run; it waits for Andrew's yes. ### Deferred and Out of Scope - Deferred: a checkbox for `--existing` on the form. Revisit if people want a summary of the last runs without starting new ones. - Deferred: a nightly schedule for All tests. Revisit once the button has run for a week. +- Deferred: a GitHub App in place of the token. Revisit when the token first comes up for renewal, or if the admin prefers an App. - Out of scope: what each CI workflow tests, including a Linux job for Workshop's three app crates, which needs its own plan. @@ -193,11 +209,12 @@ None - Work items: - Commit this plan alone on the branch `run-all-tests`, made from `upstream/master`. - Add `tools/run-all-tests.mjs`, `tools/run-all-tests.test.mjs`, and `.github/workflows/all-tests.yml`, and change `.github/workflows/ci.yml`, in one commit. - - Run the Testing Plan's local checks and record the results in this plan. - - With Andrew's yes, create the four Plugin forks, and in each of the six repos make the branch `run-all-tests` from `upstream/master` with one commit adding `workflow_dispatch:`. + - Run the unit tests, the read-only `--existing` run, the wording check, the YAML parse, and the shell-step check, and write their results under the Decision Record's notes. + - Run actionlint on `all-tests.yml` and `ci.yml`, and, with Andrew's yes, the `gh api` dispatch of `runvil-cloud-providers`'s CI, and write their results under the same notes. + - Fork the four Plugin repos, and in each of the six repos make the branch `run-all-tests` from `upstream/master` with one commit adding `workflow_dispatch:`. - With Andrew's yes, push the seven branches to his forks and open the seven pull requests, `runvil` first; the other six link to it. - - After the `runvil` pull request merges, ask an admin to create the token and the secret. - - Click Run workflow, and record the result in this plan. + - After the `runvil` pull request merges, ask an admin to add the secret. + - Click Run workflow, and write the result under the Decision Record's notes. - Dependencies and verification: - The six one-line pull requests and the `runvil` pull request can merge in any order. Until a repo's line merges, its row reads not started. - GitHub shows the Run workflow button only once `all-tests.yml` is on `master` of `cppalliance/runvil`. From 84f4c67228d0017cb00a791b17499576c48508a4 Mon Sep 17 00:00:00 2001 From: Andrew Rogers <87336074+rogers-andrew@users.noreply.github.com> Date: Thu, 3 Dec 2026 12:06:44 -0800 Subject: [PATCH 4/4] Fix three faults in All tests that review found A cancelled CI run now lists its failed and cancelled jobs, as the plan specifies. A run's jobs come from the attempt whose result was recorded, so a re-run cannot mix its jobs into the summary. Reading jobs and logs stops 176 minutes after the start, so the summary is written before GitHub stops the job at 180 minutes. Each fix has a test, and a job with one failed test no longer reads "1 failed tests". Co-Authored-By: Claude Opus 5.5 --- tools/run-all-tests.mjs | 50 ++++++++---- tools/run-all-tests.test.mjs | 84 ++++++++++++++++++++- vibe/2026-12-03-1-run-all-tests-workflow.md | 42 +++++++---- 3 files changed, 140 insertions(+), 36 deletions(-) diff --git a/tools/run-all-tests.mjs b/tools/run-all-tests.mjs index ce40ff85e..7b55740f8 100644 --- a/tools/run-all-tests.mjs +++ b/tools/run-all-tests.mjs @@ -49,6 +49,11 @@ const POLL_MS = 60_000; // The workflow's job stops at 180 minutes; stopping here first leaves time // to read the finished runs and write the summary. const DEADLINE_MS = 170 * 60_000; +// Reading one job's log takes up to two requests of REQUEST_TIMEOUT_MS each, +// so the last read that starts by this time ends a minute later, which +// leaves time to write the summary before the job stops. +const LOG_DEADLINE_MS = 176 * 60_000; +const TIME_LIMIT_TEXT = `All tests stops reading jobs and logs ${LOG_DEADLINE_MS / 60_000} minutes after it starts, so that it writes this summary before GitHub stops its job at 180 minutes`; const MAX_READ_FAILURES = 5; const REQUEST_TIMEOUT_MS = 30_000; const JOBS_PER_PAGE = 100; @@ -191,13 +196,15 @@ function parseJson(text) { export async function runAllTests({ github, extras = [], existing = false, now = Date.now, sleep = delay, log = console.log }) { const workflows = [...CI_WORKFLOWS, ...extras.map((extra) => EXTRA_WORKFLOWS[extra])]; const results = workflows.map((workflow) => ({ workflow, jobs: [], readFailures: 0 })); + const started = now(); for (const result of results) { await start(github, result, existing); if (result.runId !== undefined) log(`${label(result)}: ${runUrl(result)}`); } - await waitForRuns(github, results, { now, sleep, log }); + await waitForRuns(github, results, { deadline: started + DEADLINE_MS, now, sleep, log }); + const reading = { deadline: started + LOG_DEADLINE_MS, now }; for (const result of results) { - if (result.run?.status === "completed") await readJobs(github, result); + if (result.run?.status === "completed") await readJobs(github, result, reading); } return { markdown: renderSummary(results, { existing }), passed: results.every(passedRun) }; } @@ -230,8 +237,7 @@ async function start(github, result, existing) { } } -async function waitForRuns(github, results, { now, sleep, log }) { - const deadline = now() + DEADLINE_MS; +async function waitForRuns(github, results, { deadline, now, sleep, log }) { let waiting = results.filter((result) => result.runId !== undefined); for (;;) { for (const result of waiting) await readRun(github, result); @@ -265,19 +271,25 @@ function noteReadFailure(result, message) { if (result.readFailures >= MAX_READ_FAILURES) result.readError = message; } -async function readJobs(github, result) { +// The jobs come from the attempt whose result `readRun` recorded, so a +// re-run started while other runs are still going cannot mix two attempts. +async function readJobs(github, result, reading) { const { repo } = result.workflow; try { for (let page = 1; ; page += 1) { + if (reading.now() >= reading.deadline) { + result.jobsError = TIME_LIMIT_TEXT; + return; + } const response = await github.call( "GET", - `/repos/${OWNER}/${repo}/actions/runs/${result.runId}/jobs?filter=latest&per_page=${JOBS_PER_PAGE}&page=${page}`, + `/repos/${OWNER}/${repo}/actions/runs/${result.runId}/attempts/${result.run.run_attempt}/jobs?per_page=${JOBS_PER_PAGE}&page=${page}`, ); if (response.status !== 200) { result.jobsError = describe(response); return; } - for (const job of response.data.jobs) result.jobs.push(await readJob(github, repo, job)); + for (const job of response.data.jobs) result.jobs.push(await readJob(github, repo, job, reading)); if (response.data.jobs.length < JOBS_PER_PAGE) return; } } catch (error) { @@ -285,9 +297,13 @@ async function readJobs(github, result) { } } -async function readJob(github, repo, job) { +async function readJob(github, repo, job, reading) { const entry = { name: job.name, url: job.html_url, conclusion: job.conclusion, counts: null, failedTests: [] }; if (job.conclusion === null || job.conclusion === "skipped") return entry; + if (reading.now() >= reading.deadline) { + entry.logError = TIME_LIMIT_TEXT; + return entry; + } try { const response = await github.call("GET", `/repos/${OWNER}/${repo}/actions/jobs/${job.id}/logs`); if (response.status !== 302 || response.location === undefined) { @@ -379,19 +395,21 @@ function problemLines(result) { if (result.readError !== undefined) return [`- ${name} ${run}: its state could not be read: ${result.readError}`]; if (result.stillRunning) return [`- ${name} ${run} was still running ${DEADLINE_MS / 60_000} minutes after this run started.`]; const lines = []; - if (result.run.conclusion === "cancelled" && result.workflow.file === "ci.yml") { - lines.push( - `- ${name} ${run} was cancelled. A push to ${BRANCH} cancels a CI run on ${BRANCH} that is still going, and the push's own CI run tests the newer commit.`, - ); - } else if (result.run.conclusion !== "success") { - lines.push(`- ${name} ${run} ended in ${result.run.conclusion}.`); + if (result.run.conclusion !== "success") { + if (result.run.conclusion === "cancelled" && result.workflow.file === "ci.yml") { + lines.push( + `- ${name} ${run} was cancelled. A push to ${BRANCH} cancels a CI run on ${BRANCH} that is still going, and the push's own CI run tests the newer commit.`, + ); + } else { + lines.push(`- ${name} ${run} ended in ${result.run.conclusion}.`); + } for (const job of result.jobs.filter((entry) => !["success", "skipped", null].includes(entry.conclusion))) { lines.push(...failedJobLines(job)); } } if (result.jobsError !== undefined) lines.push(`- ${name} ${run}: its jobs could not be read: ${result.jobsError}`); for (const job of result.jobs.filter((entry) => entry.logError !== undefined)) { - lines.push(`- ${name}: the log of job [${job.name}](${job.url}) could not be read, so its tests are not counted: ${job.logError}`); + lines.push(`- ${name}: the tests of job [${job.name}](${job.url}) are not counted: ${job.logError}`); } return lines; } @@ -402,7 +420,7 @@ function failedJobLines(job) { const shown = job.failedTests.slice(0, MAX_LISTED_TESTS).map((test) => ` - \`${test.replaceAll("`", "'")}\``); const left = job.failedTests.length - shown.length; return [ - `${head}, with ${job.failedTests.length} failed tests:`, + `${head}, with ${job.failedTests.length} failed ${job.failedTests.length === 1 ? "test" : "tests"}:`, ...shown, ...(left > 0 ? [` - and ${left} more`] : []), ]; diff --git a/tools/run-all-tests.test.mjs b/tools/run-all-tests.test.mjs index f826e04a7..6be4eb6ff 100644 --- a/tools/run-all-tests.test.mjs +++ b/tools/run-all-tests.test.mjs @@ -111,11 +111,12 @@ test("the command line takes each extra by name and rejects others", () => { assert.throws(() => parseArguments(["--extra", "miri"]), { message: "unknown --extra miri; the extras are stt-miri, installers, bundle" }); }); -function completedRun(id, conclusion) { +function completedRun(id, conclusion, attempt = 1) { return { id, status: "completed", conclusion, + run_attempt: attempt, head_sha: "af9eb141d0123456789", run_started_at: "2026-12-03T14:08:28Z", updated_at: "2026-12-03T14:11:12Z", @@ -148,6 +149,23 @@ test("the summary gives one row per workflow and lists what failed", () => { assert.ok(markdown.includes("- **runvil-plugin-api CI** could not start: HTTP 422: Workflow does not have 'workflow_dispatch' trigger")); }); +test("a cancelled CI run still lists the jobs that failed and their failed tests", () => { + const job = (name, conclusion, failedTests = []) => ({ name, url: `https://example.test/${name}`, conclusion, counts: null, failedTests }); + const results = [ + { + workflow: CI_WORKFLOWS[2], + runId: 12, + run: completedRun(12, "cancelled"), + jobs: [job("check-workshop", "failure", ["t0"]), job("check-gateway", "cancelled"), job("fmt", "success")], + }, + ]; + const markdown = renderSummary(results); + assert.ok(markdown.includes("was cancelled. A push to master cancels a CI run on master that is still going")); + assert.ok(markdown.includes(" - Job [check-workshop](https://example.test/check-workshop) ended in failure, with 1 failed test:\n - `t0`")); + assert.ok(markdown.includes(" - Job [check-gateway](https://example.test/check-gateway) ended in cancelled.")); + assert.ok(!markdown.includes("Job [fmt]")); +}); + // A stand-in for GitHub's REST API. Each run is in progress for the first // two reads of its state and then finishes; runvil-plugin-std's CI cannot be // dispatched, runvil-workshop's fails, and runvil-harness has 101 jobs, two @@ -172,7 +190,7 @@ function fakeGitHub() { if (reads.get(id) <= 2) return { status: 200, data: { id, status: "in_progress", conclusion: null } }; return { status: 200, data: completedRun(id, repoOf(id) === "runvil-workshop" ? "failure" : "success") }; } - if ((match = /^\/repos\/cppalliance\/[\w-]+\/actions\/runs\/(\d+)\/jobs\?filter=latest&per_page=100&page=(\d+)$/.exec(path))) { + if ((match = /^\/repos\/cppalliance\/[\w-]+\/actions\/runs\/(\d+)\/attempts\/1\/jobs\?per_page=100&page=(\d+)$/.exec(path))) { const id = Number(match[1]); const page = Number(match[2]); const count = repoOf(id) === "runvil-harness" ? (page === 1 ? 100 : 1) : page === 1 ? 2 : 0; @@ -221,7 +239,7 @@ test("runAllTests dispatches every CI workflow, waits for the runs, and summariz assert.ok(markdown.includes("| failure | 3 | 426 / 4 / 13 |")); assert.ok(markdown.includes(` - \`${FAILED_TESTS[3]}\``)); assert.ok(markdown.includes("- **runvil-plugin-std CI** could not start: HTTP 422: Workflow does not have 'workflow_dispatch' trigger")); - assert.ok(calls.includes("GET /repos/cppalliance/runvil-harness/actions/runs/2/jobs?filter=latest&per_page=100&page=2")); + assert.ok(calls.includes("GET /repos/cppalliance/runvil-harness/actions/runs/2/attempts/1/jobs?per_page=100&page=2")); assert.ok(progress.some((line) => line.startsWith("waiting for 8 runs: runvil CI (in_progress)"))); }); @@ -247,6 +265,64 @@ test("a run that is still going at the deadline is reported as still running", a assert.ok(markdown.includes("was still running 170 minutes after this run started.")); }); +test("the jobs are read from the attempt whose result was recorded, not from a later re-run", async () => { + const calls = []; + const github = { + async call(method, path) { + calls.push(`${method} ${path}`); + if (method === "POST") return { status: 200, data: { workflow_run_id: 7 } }; + if (path.endsWith("/runs/7")) return { status: 200, data: completedRun(7, "failure", 2) }; + if (path.includes("/runs/7/attempts/2/jobs?")) { + return { status: 200, data: { jobs: [{ id: 70, name: "test", html_url: "https://example.test/70", conclusion: "failure" }] } }; + } + if (path.endsWith("/jobs/70/logs")) return { status: 302, location: "https://logs.example.test/70" }; + throw new Error(`unexpected ${method} ${path}`); + }, + async download() { + return NEXTEST_FAIL; + }, + }; + const { markdown } = await runAllTests({ github, now: () => 0, sleep: async () => {}, log: () => {} }); + assert.ok(calls.includes("GET /repos/cppalliance/runvil/actions/runs/7/attempts/2/jobs?per_page=100&page=1")); + assert.ok(!calls.some((call) => call.includes("/attempts/1/") || call.includes("filter="))); + assert.ok(markdown.includes("| failure | 3 | 426 / 4 / 13 |")); +}); + +test("near the job's time limit the jobs and logs left unread are listed and the summary is still written", async () => { + let clock = 0; + const downloads = []; + const github = { + async call(method, path) { + if (method === "POST") { + const repo = path.split("/")[3]; + return { status: 200, data: { workflow_run_id: CI_WORKFLOWS.findIndex((workflow) => workflow.repo === repo) + 1 } }; + } + let match; + if ((match = /\/runs\/(\d+)$/.exec(path))) return { status: 200, data: completedRun(Number(match[1]), "success") }; + if ((match = /\/runs\/(\d+)\/attempts\/1\/jobs\?/.exec(path))) { + const id = Number(match[1]); + const jobs = [0, 1].map((i) => ({ id: id * 10 + i, name: `job ${i}`, html_url: `https://example.test/${id * 10 + i}`, conclusion: "success" })); + return { status: 200, data: { jobs } }; + } + if ((match = /\/jobs\/(\d+)\/logs$/.exec(path))) return { status: 302, location: `https://logs.example.test/${match[1]}` }; + throw new Error(`unexpected ${method} ${path}`); + }, + async download(url) { + downloads.push(url); + clock = 176 * 60_000; + return NEXTEST_PASS; + }, + }; + const { markdown, passed } = await runAllTests({ github, now: () => clock, sleep: async () => {}, log: () => {} }); + assert.deepEqual(downloads, ["https://logs.example.test/10"]); + assert.equal(passed, true); + assert.match(markdown, /^## All tests: 9 of 9 runs passed$/m); + assert.ok(markdown.includes("| success | 3 | 3345 / 0 / 24 |")); + const reason = "All tests stops reading jobs and logs 176 minutes after it starts, so that it writes this summary before GitHub stops its job at 180 minutes"; + assert.ok(markdown.includes(`- **runvil CI**: the tests of job [job 1](https://example.test/11) are not counted: ${reason}`)); + assert.ok(markdown.includes(`- **runvil-harness CI** ([run](https://github.com/cppalliance/runvil-harness/actions/runs/2)): its jobs could not be read: ${reason}`)); +}); + test("--existing reads the newest finished run of each workflow and starts nothing", async () => { const calls = []; const github = { @@ -254,7 +330,7 @@ test("--existing reads the newest finished run of each workflow and starts nothi calls.push(`${method} ${path}`); if (path.includes("/workflows/ci.yml/runs?branch=master&status=completed&per_page=1")) return { status: 200, data: { workflow_runs: [{ id: 5 }] } }; if (path.endsWith("/runs/5")) return { status: 200, data: completedRun(5, "success") }; - if (path.includes("/runs/5/jobs?")) return { status: 200, data: { jobs: [] } }; + if (path.includes("/runs/5/attempts/1/jobs?")) return { status: 200, data: { jobs: [] } }; throw new Error(`unexpected ${method} ${path}`); }, }; diff --git a/vibe/2026-12-03-1-run-all-tests-workflow.md b/vibe/2026-12-03-1-run-all-tests-workflow.md index 054bd17e9..da8c611e9 100644 --- a/vibe/2026-12-03-1-run-all-tests-workflow.md +++ b/vibe/2026-12-03-1-run-all-tests-workflow.md @@ -15,11 +15,14 @@ todos: content: "Run actionlint on all-tests.yml and ci.yml, and with Andrew's yes the gh api dispatch of runvil-cloud-providers' CI" status: pending - id: one-line-commits - content: "Fork the four Plugin repos, and commit workflow_dispatch in ci.yml on a branch run-all-tests in runvil-harness, runvil-workshop, and the four Plugin repos" - status: in_progress + content: "Commit workflow_dispatch in ci.yml in runvil-harness, runvil-workshop, and the four Plugin repos, and push each commit to master" + status: completed - id: prs - content: "With Andrew's yes, push the seven branches to his forks and open the seven pull requests" - status: pending + content: "With Andrew's yes, push run-all-tests to his fork and open the runvil pull request" + status: completed + - id: review-fixes + content: "Fix the three findings of CodeRabbit's review that Andrew chose to fix, each with a test" + status: completed - id: token content: "After the runvil PR merges, an admin stores a token as RUNVIL_ALL_TESTS_TOKEN in cppalliance/runvil" status: pending @@ -90,12 +93,14 @@ A person clicks Run workflow, ticks the extras they want, and confirms. One job - Failed test names come from nextest's `FAIL` and `TIMEOUT` lines and from its lines that start with a signal name such as `SIGSEGV` or `SIGABRT` (a test process killed by that signal), from `cargo test`'s `test ... FAILED` lines, and from TAP's `not ok N - ` lines, each name listed once. - A job such as `fmt` or `clippy`, which prints none of the three formats, adds only its result to the summary. A job that runs tests and other checks adds the counts of its tests. - The script stops waiting 170 minutes after it starts; runs still going then are reported as still running and fail the All tests run. The job's own limit is 180 minutes. + - The script stops reading jobs and logs 176 minutes after it starts. Each run whose jobs and each job whose log it has not read by then is listed with that reason, the run's result still comes from GitHub, and the summary is written before the job's limit. + - A run's jobs are those of the attempt whose result the script recorded. A re-run started after that, by the Re-run button on the run's page, adds an attempt whose jobs the summary leaves out. - Errors and recovery: - When `GH_TOKEN` is empty, the script fails at once with a message that names the secret `RUNVIL_ALL_TESTS_TOKEN` and the repo it belongs in. - When GitHub refuses a dispatch, that workflow is reported as not started with the HTTP status and GitHub's message, and the others go on. GitHub answers 422 when the workflow's `on:` block lacks `workflow_dispatch`, 401 when the token has expired or been revoked, and 403 or 404 when the token cannot reach the repo. - A failed read of a run's state (a network error, or any status other than 200, such as a 5xx or a 401 from a token that expired during the run) is retried on the next minute's round. After five failures in a row for one run, its result reads `unreadable`, the summary gives the last error, and the All tests run fails. A failed read of a run's jobs is listed with its error, and the run's result still comes from GitHub. - When a job's log cannot be downloaded, the job adds its result without counts, and the summary lists the error. - - A cancelled CI run on `master` is listed with the reason most likely for it: a push to `master` cancels a dispatched CI run, and the newer push's own run tests the newer commit. + - A cancelled CI run on `master` is listed with the reason most likely for it: a push to `master` cancels a dispatched CI run, and the newer push's own run tests the newer commit. Its failed, timed-out, and cancelled jobs are listed under it, as for any run that did not succeed. - Cancelling the All tests run leaves the runs it started running in their own repos. - Security and privacy behavior: - The token reaches the script only through the `GH_TOKEN` environment variable of its step, and GitHub masks secrets in logs. For a failed request the summary gives the HTTP status and GitHub's message, and the script never prints request headers. @@ -103,7 +108,7 @@ A person clicks Run workflow, ticks the extras they want, and confirms. One job - The nine repos are public, so the summary shows only results and logs that anyone can read already. - Acceptance criteria: - With the boxes unticked, the summary lists nine CI runs, and the All tests run passes when all nine pass. - - Before the six one-line pull requests (in `runvil-harness`, `runvil-workshop`, and the four `runvil-plugin-*` repos) merge, those six CI workflows appear as not started with GitHub's 422 message, and the All tests run fails. + - A CI workflow whose `on:` block lacks `workflow_dispatch` appears as not started with GitHub's 422 message, and the All tests run fails. - The counts for the `master` runs of 2026-12-03 match their logs: `runvil-harness` job `test` 3345 passed and 24 skipped, `runvil-workshop` job `check-workshop` 436 passed and 9 skipped, `runvil-plugin-api` job `test (ubuntu-latest)` 271 passed. @@ -117,10 +122,10 @@ A new dispatch-only workflow in `cppalliance/runvil` runs a Node script that dri - `.github/workflows/all-tests.yml`: `on: workflow_dispatch` with the three boolean inputs; `concurrency: { group: all-tests, cancel-in-progress: false }`, so a second click waits for the first run; `permissions: { contents: read }`; one job on `ubuntu-latest` with `timeout-minutes: 180` that checks out the repo, sets up Node 22, and runs the script with `GH_TOKEN: ${{ secrets.RUNVIL_ALL_TESTS_TOKEN }}`. - A normal run calls four endpoints, all under `https://api.github.com/repos/cppalliance//actions`. - `POST /workflows//dispatches` with `{"ref": "master", "return_run_details": true}` returns 200 with `workflow_run_id`, `run_url`, and `html_url`. - - `GET /runs/` gives the run's `status`, `conclusion`, `head_sha`, `run_started_at`, and `updated_at`. - - `GET /runs//jobs?filter=latest&per_page=100&page=` gives the jobs, 100 at a time; the script asks for the next page until one holds fewer than 100. + - `GET /runs/` gives the run's `status`, `conclusion`, `run_attempt`, `head_sha`, `run_started_at`, and `updated_at`. The script stops reading a run once it is completed. + - `GET /runs//attempts//jobs?per_page=100&page=` gives the jobs of the attempt the script recorded, 100 at a time; the script asks for the next page until one holds fewer than 100. Reading the run's latest jobs instead could mix in a re-run's jobs. - `GET /jobs//logs` answers 302 with a download address that is valid for one minute. The script reads that address from the reply and downloads the log with a second request that omits the token, because the address points at storage outside GitHub's API. - - Each API request sends `Accept: application/vnd.github+json` and `X-GitHub-Api-Version: 2022-11-28`, and every request gives up after 30 seconds. + - Each API request sends `Accept: application/vnd.github+json` and `X-GitHub-Api-Version: 2022-11-28`, and every request gives up after 30 seconds. A job's log takes at most two requests, so a log read that starts before the 176-minute mark ends by 177 minutes, which leaves time to write the summary. - Modules and interfaces: - `tools/run-all-tests.mjs` holds the list of workflows (the nine CI workflows and the three extras) and exports `parseTestCounts(logText)`, `renderSummary(results)`, `parseArguments(args)`, `githubClient(token)`, and `runAllTests({ github, extras, existing, now, sleep, log })`. - `github` holds the two functions that talk to GitHub: `call`, one REST call, which answers the status, the parsed JSON body, and a redirect's address; and `download`, one log download. `githubClient(token)` makes the real pair, and the tests pass a stand-in GitHub. `now` and `sleep` read the clock and wait a minute between rounds; the tests replace them so that a test of the 170-minute limit runs at once. `log` prints the progress lines. @@ -129,7 +134,7 @@ A new dispatch-only workflow in `cppalliance/runvil` runs a Node script that dri - `tools/run-all-tests.test.mjs` holds the tests (`node:test`). - File and public API changes: - `cppalliance/runvil`: add `.github/workflows/all-tests.yml`, `tools/run-all-tests.mjs`, and `tools/run-all-tests.test.mjs`; in `.github/workflows/ci.yml` add `workflow_dispatch:` to `on:`, add a job `scripts` that runs `node --test tools/run-all-tests.test.mjs` on Node 22, and add `scripts` to the `needs:` list of `ci-green`. - - `runvil-harness`, `runvil-workshop`, `runvil-plugin-api`, `runvil-plugin-bashkit`, `runvil-plugin-std`, and `runvil-plugin-web`: add `workflow_dispatch:` under `on:` in `.github/workflows/ci.yml`. The CI workflows of `runvil-gateway` and `runvil-cloud-providers` list it already. + - `runvil-harness`, `runvil-workshop`, `runvil-plugin-api`, `runvil-plugin-bashkit`, `runvil-plugin-std`, and `runvil-plugin-web`: add `workflow_dispatch:` under `on:` in `.github/workflows/ci.yml`, one commit per repo pushed to `master` on 2026-12-03. The CI workflows of `runvil-gateway` and `runvil-cloud-providers` list it already. - Data, persistence, failure, security, and privacy constraints: - The script keeps its state in memory for one run, and each run starts from the workflow list in its source. - The token needs Actions: Read and write on each of the nine repos: dispatch needs write, and reading runs, jobs, and logs needs read. GitHub's REST pages name only the classic `repo` scope for these calls, so the first real click confirms the fine-grained permission. An organization can require an owner to approve each fine-grained token used on its repos; whether `cppalliance` does is unknown, and if it does, an owner approves the token before the admin adds the secret. @@ -144,10 +149,10 @@ Unit tests cover the three log formats and the summary, using lines copied from - Unit: - `parseTestCounts` on excerpts of job logs of 2026-12-03: nextest from `runvil-harness` job `test` (3345 passed, 24 skipped); a failing nextest run (`430 tests run: 426 passed (6 slow), 4 failed, 13 skipped`, with four `FAIL` lines, each name printed twice), taken from a local Linux run that day of the tests of Workshop's crates `workshop`, `workshop-server`, and `workshop-server-api`; `cargo test` from `runvil-plugin-api` (six `test result:` lines adding to 271 passed); TAP from `runvil-harness` job `wording` (3 passed), and a TAP block with a `not ok` line. Each excerpt has the timestamp GitHub puts before every line and the byte-order mark at the start of a log. - - `renderSummary`: the counts line, a row with a failed job and its test names, a not-started workflow with its message, and the cap at 20 names. + - `renderSummary`: the counts line, a row with a failed job and its test names, a not-started workflow with its message, the cap at 20 names, and a cancelled CI run that lists its failed and cancelled jobs. - `parseArguments`: each extra by name, `--existing`, and an unknown extra refused with the list of extras. - Integration and end-to-end: - - `runAllTests` against a stand-in GitHub: one dispatch answered 200, one refused with 422, runs that go from in progress to completed over three rounds, two pages of jobs, and job logs. The test checks the summary and that `runAllTests` reports the All tests run as failed. Two more tests cover a run still going at the 170-minute limit and `--existing`, which must send no dispatch. + - `runAllTests` against a stand-in GitHub: one dispatch answered 200, one refused with 422, runs that go from in progress to completed over three rounds, two pages of jobs, and job logs. The test checks the summary and that `runAllTests` reports the All tests run as failed. Four more tests cover a run still going at the 170-minute limit, jobs read from the attempt the run reported (attempt 2 in the test), the 176-minute limit on reading, and `--existing`, which must send no dispatch. - A read-only local run, `GH_TOKEN=$(gh auth token) node tools/run-all-tests.mjs --existing`, against the `master` runs of 2026-12-03, whose per-job counts must match the three counts under Acceptance criteria. - One `gh api` dispatch of `runvil-cloud-providers`'s CI (about one minute; it accepts dispatches already) with `return_run_details: true`, to confirm the reply's fields. It runs only with Andrew's yes, because it starts a run under his name. - After merge and the secret: one click with the boxes unticked. @@ -169,7 +174,8 @@ Unit tests cover the three log formats and the summary, using lines copied from - The button and the script live in `cppalliance/runvil`, and an admin stores the token there. Everyone who can open that repo's Actions tab can read the summary, and each CI run happens in its own repo with its own cache, as on a push. On 2026-12-03 Andrew chose this from three options: this one, a repo of his own with his personal token, and one combined run that calls every CI workflow from `runvil`. - All tests always starts the nine CI workflows, and the form offers the extras as checkboxes that start unticked. Andrew chose this over starting the nine CI workflows alone. - The summary shows job results and test counts read from job logs, with failed test names. Andrew chose this over job results alone, accepting that a change in a test runner's output format can stop the counts until the parser follows it. - - Changes reach `cppalliance` repos as pull requests from a person's fork. Andrew has forks of `runvil`, `runvil-harness`, `runvil-workshop`, and `runvil-gateway`, and on 2026-12-03 he agreed to fork `runvil-plugin-api`, `runvil-plugin-bashkit`, `runvil-plugin-std`, and `runvil-plugin-web` for their one-line pull requests. GitHub makes a fork of a public repo public, and each of these forks holds only its one-line branch. + - The `runvil` change goes up as a pull request from Andrew's fork. The six one-line changes went up first as pull requests too, from forks; Andrew forked the four Plugin repos for them on 2026-12-03, and GitHub makes a fork of a public repo public. Later that day Vinnie Falco asked that one-line changes skip pull requests, so the six pull requests were closed unmerged and each commit was pushed to its repo's `master`. + - CodeRabbit's review of the `runvil` pull request found three faults, and on 2026-12-03 Andrew chose to fix all three, each with a test. A cancelled CI run listed no failed jobs, against this plan's specification. The script read a run's latest jobs, so a re-run started while All tests was waiting for other runs could mix its jobs and counts into the first attempt's result. Reading jobs and logs had no time limit, so a run that ended at the 170-minute mark could leave the summary unwritten when GitHub stops the job at 180 minutes. - The script reads the run ID from the dispatch reply, using `return_run_details`, which GitHub added on 2026-02-19. Matching runs by start time could pick a push run that started in the same minute. - Rejected alternatives: - One combined run in which `runvil`'s workflow calls each CI workflow as a reusable workflow. It works with the run's own token, but each called workflow checks out the calling repo, so every checkout step in all nine CI workflows would need a repository argument, and all nine repos' caches would share `runvil`'s 10 GB cache limit and evict `runvil`'s own. Revisit if the token cannot be had. @@ -186,6 +192,9 @@ Unit tests cover the three log formats and the summary, using lines copied from - Both workflow files parse as YAML, `ci-green` lists the new `scripts` job, and the shell step of `all-tests.yml`, run with `node` replaced by `echo`, passes `--extra stt-miri --extra bundle` for those two boxes and no argument when every box is unticked. - actionlint was not run: the permission check of Claude Code, the coding agent that ran these checks, refused to download and run its release binary. - The `gh api` dispatch check has not run; it waits for Andrew's yes. + - Result of the checks after the review fixes, on 2026-12-03: + - `node --test tools/run-all-tests.test.mjs`: 16 passed. Three copies of the script, each with one fix undone, each failed that fix's test and no other. The new test of a cancelled run also showed that a job with one failed test read "with 1 failed tests", which is fixed. + - `--existing` read the newest finished `master` runs through the attempt endpoint in 52 seconds and reported 9 of 9 passed. GitHub's log storage answered HTTP 503 to two log downloads, of `runvil-plugin-bashkit`'s `fmt` and `docs` jobs, which run no tests; the summary listed both as not counted. ### Deferred and Out of Scope @@ -211,12 +220,13 @@ None - Add `tools/run-all-tests.mjs`, `tools/run-all-tests.test.mjs`, and `.github/workflows/all-tests.yml`, and change `.github/workflows/ci.yml`, in one commit. - Run the unit tests, the read-only `--existing` run, the wording check, the YAML parse, and the shell-step check, and write their results under the Decision Record's notes. - Run actionlint on `all-tests.yml` and `ci.yml`, and, with Andrew's yes, the `gh api` dispatch of `runvil-cloud-providers`'s CI, and write their results under the same notes. - - Fork the four Plugin repos, and in each of the six repos make the branch `run-all-tests` from `upstream/master` with one commit adding `workflow_dispatch:`. - - With Andrew's yes, push the seven branches to his forks and open the seven pull requests, `runvil` first; the other six link to it. + - In each of the six repos, commit `workflow_dispatch:` on a branch `run-all-tests` made from `upstream/master`, and push the commit to `master`. + - With Andrew's yes, push `run-all-tests` to his fork and open the `runvil` pull request. + - Fix the review findings Andrew chooses to fix, with a test each, in one commit on the pull request's branch. - After the `runvil` pull request merges, ask an admin to add the secret. - Click Run workflow, and write the result under the Decision Record's notes. - Dependencies and verification: - - The six one-line pull requests and the `runvil` pull request can merge in any order. Until a repo's line merges, its row reads not started. + - The six one-line commits are on `master`, so every CI workflow accepts a dispatch once the `runvil` pull request merges. - GitHub shows the Run workflow button only once `all-tests.yml` is on `master` of `cppalliance/runvil`. - A local run needs Node 22 or later and a token in `GH_TOKEN`; `--existing` needs only read access.