Skip to content

ci(tests): run the tests on the maintainers' PRs, per platform label, with one results comment - #969

Draft
mihailt wants to merge 12 commits into
test/node-test-runnerfrom
framework/2-ci
Draft

mihailt wants to merge 12 commits into
test/node-test-runnerfrom
framework/2-ci

Conversation

@mihailt

@mihailt mihailt commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator

The tests now run in CI for the maintainers' PRs, on each platform the PR is labelled with, and one PR comment shows each platform's results and coverage. This builds on #966, the test runner.

What this adds

Problem Fix
No CI runs the tests on a PR; only a release runs them, on Linux. .github/workflows/tests.yml runs them on each labelled platform: linux, windows, macos.
A maintainer can't run one platform or one commit on demand. A /test windows comment, or gh workflow run tests.yml -f commit=… -f platforms=…, runs it.
Timed tests can't run on a shared machine. -f tests=timed runs each timed test in a job of its own, per platform.
Results are only in the run's log. test/ci-comment.js keeps one PR comment: a row per platform, its coverage and report links.

Where to look

  • .github/workflows/tests.yml: the triggers, the platforms job, and the unit job per platform.
  • test/helpers/ci-platforms.js: MAINTAINERS, and which platforms and tests each event runs.
  • test/ci-comment.js: the PR comment, built from each platform's results.
  • test/helpers/github-api.js, test/helpers/workflow-file.js: the GitHub calls, and the workflow lines the tests read.
  • test/README.md: its CI section.

How to verify

npm run build && node test/run-all-tests.js test-ci-platforms.js test-ci-comment.js
gh workflow run tests.yml -f commit=<sha> -f platforms=linux   # once the workflow is on main
Tests and results
  • test-ci-platforms.js: which events start a run, for whom, on which platforms, and the workflow's own lines.
  • test-ci-comment.js: the comment's tables, from made-up results of each platform.
  • Most of this PR's changes came test first: the commit before each added its test, which failed there.
  • At 9db23303, these tests and the coverage check are being run on Windows, macOS and Linux.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@mihailt mihailt added linux CI: run the tests on Linux windows CI: run the tests on Windows macos CI: run the tests on macOS labels Oct 30, 2026
@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Tests and coverage for c4a7727

Platform Tests Ran Minutes Commit Run
Linux ✅ 1 of 1 files passed files:test-interact-output-cleaning.js 1 c4a7727 run
Windows ✅ 226 of 226 files passed; Docker: GitHub's Windows runner has no Docker for Linux containers; 9 checks skipped everything 30 a383442 run
macOS ❌ no results everything 15 a383442 run
Platform Lines Branches Functions Report (HTML, lcov, JSON, Cobertura) Results (JUnit, JSON, TAP)
Linux 19.05 % 49.82 % 15.66 % coverage-ubuntu-latest results-ubuntu-latest
Windows 66.46 % 79.74 % 81.05 % coverage-windows-latest results-windows-latest
macOS – – – – –
Combined – – – needs Linux, Windows and macOS in one run –
Lines by area
Area Linux Windows
install scripts 0 % (0/2074) 0 % (0/2074)
src/* 35 % (1990/5681) 90 % (5115/5681)
src/handlers 28.8 % (299/1038) 82.9 % (860/1038)
src/npm-scripts 0 % (0/227) 24.2 % (55/227)
src/remote-device 0 % (0/5656) 89.1 % (5038/5656)
src/tools 30.9 % (1666/5386) 79.4 % (4279/5386)
src/ui 2.1 % (168/8127) 35.2 % (2863/8127)
src/utils 36.7 % (2656/7229) 73.9 % (5341/7229)
vendor/telemetry-contract 0 % (0/164) 59.1 % (97/164)
total 19.1 % (6779/35582) 66.5 % (23648/35582)

@mihailt mihailt added linux CI: run the tests on Linux and removed linux CI: run the tests on Linux labels Oct 30, 2026
@mihailt mihailt changed the title ci: run the tests on the maintainers' PRs, per platform label, with one results comment ci(tests): run the tests on the maintainers' PRs, per platform label, with one results comment Oct 30, 2026
@mihailt
mihailt force-pushed the test/node-test-runner branch from b51284b to e704cff Compare November 2, 2026 06:38
@mihailt
mihailt force-pushed the framework/2-ci branch 3 times, most recently from 5abbf52 to 84fdcb2 Compare November 2, 2026 14:33
@mihailt
mihailt force-pushed the test/node-test-runner branch from d538f4f to cdd5316 Compare November 3, 2026 22:47
@mihailt
mihailt force-pushed the test/node-test-runner branch from cdd5316 to 8bc554e Compare November 4, 2026 04:12
mihailt and others added 9 commits November 4, 2026 15:41
…el, with one PR comment

.github/workflows/tests.yml runs npm run test:coverage on Node 22 with npm
11, for PRs opened by the maintainers in MAINTAINERS
(test/helpers/ci-platforms.js):
- the labels linux, windows and macos pick the platforms; a push runs every
  labelled one, adding a label runs its platform at once;
- a maintainer's /test linux windows comment runs those platforms on the
  PR's head, and gh workflow run tests.yml runs any commit on demand, with
  a tests value (empty for everything, or test, integration, repro, docker,
  timed, changed:A..B, files:a.js,b.js); tests=timed runs one job per timed
  test;
- one PR comment, with no prose: a results row and a coverage row per
  platform, and the lines by area. It fails closed: a job that failed, an
  unreadable results.json, or no test run is never a pass.
A comment's or on-demand run tests unmerged code with a read-only token, no
secret and no npm cache; the comment job runs main's script. test/README.md
says how.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…g first)

The repro's first install took 522 s on GitHub's Windows from its own empty
npm cache. test-ci-platforms.js checks a step after npm ci, before the tests,
names the job's npm cache (npm config get cache) as REPRO_NPM_CACHE. Fails
until the workflow does so.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… CI files name no later step

- A step after npm ci names the job's npm cache (npm config get cache) as
  REPRO_NPM_CACHE, so the release-packages repro's installs read from it
  instead of an empty cache: its first install took 522 s on GitHub's
  Windows, and once ran the repro into its 10-minute guard.
- tests.yml, test/README.md and helpers/ci-platforms.js named the AI review,
  which the next pull request adds; startedBy's on-demand branch is reached
  only by the review. check-coverage-report.js's header names the CI scripts
  this PR adds to TEST_TOOLING.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…g first)

GitHub sends opened, then a labeled event for each label on a new PR. With
opened in tests.yml's types, opened ran every labelled platform and each
labeled event ran its platform again: each platform twice (#233, 30 Oct: 7
runs at once, Windows twice). test-ci-platforms.js replays those events
against the workflow's own types and counts each platform's runs; the review
label's event must pick no platform. Fails until opened starts nothing.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
GitHub sends opened, then a labeled event for each label a new PR has. With
opened among tests.yml's pull_request types, opening a PR ran every labelled
platform, and each labeled event ran its platform again: each platform twice
(#233: 7 runs at once, Windows twice). opened is out of the types, and
platformsFor no longer treats it as a push; a push and a reopen still run
every labelled platform, and the review label's event picks no platform.
test/README.md says so.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… line and its job (failing first)

"207 of 211 files passed" on Windows said nothing of which 4. The comment
gets a table of the failed files per platform: each linked to the job it
ran in, with its first error line (a ❌ or ✗ line, else one naming an
Error, else its last line; never a ✓ line that mentions an error), at
most 20 per platform and the rest counted.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…t error line and its job

ci-comment.js keeps, for each failed file, unreadable results part and
stopped job, its first error line (firstError: a ❌ or ✗ line, else one
naming an Error, never a ✓ line, else the last line) and its job's link
(the job its results artifact came from). renderComment lists them per
platform under the results, at most 20 each and the rest counted. The
error shows in a code span, so only backticks, pipes and line breaks are
taken out ("BLOCKED >30000ms" keeps its >); the test now says so.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…hows the three platforms combined (failing first)

- test-ci-platforms.js: tests.yml's on-demand tests_from input is checked
  as a SHA and resolved like commit, through the environment only. The
  test job takes test/ from it before the install. A cross run writes no
  PR comment, and the heading names both commits.
- The same test: the comment gets a Combined row under the platforms and a
  Combined column by area. Only one run's own three coverage-final.json
  files make it. With fewer, or one that can't be read, the row has no
  figure and says why.
- test-ci-comment.js: TESTS_FROM names the tests' commit in the heading,
  and the three platforms' reports give the Combined figure.
Fails until tests.yml, ci-comment.js and ci-platforms.js do so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ined row and column

- tests.yml's on-demand tests_from runs that commit's test/ on commit's
  code, as test/cross-test.js does locally. It's checked as a SHA and
  resolved like commit. The test job takes test/ from it before anything
  installs. Its rows go into the job summary only, never a PR's comment.
- ci-comment.js combines this run's three coverage-final.json files
  (test/combined-coverage.js). renderComment shows the figure under the
  platforms and as a column by area. Without the three, or with one that
  can't be read, the row has no figure and says why. mergeComment never
  carries an earlier run's figure over.
- test/README.md says how.

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

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

linux CI: run the tests on Linux macos CI: run the tests on macOS windows CI: run the tests on Windows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant