Skip to content

ci: point the Jest job at test:ci, and correct TESTING.md - #8045

Merged
renemadsen merged 1 commit into
masterfrom
ci/jest-ci-invocation
Sep 9, 2026
Merged

ci: point the Jest job at test:ci, and correct TESTING.md#8045
renemadsen merged 1 commit into
masterfrom
ci/jest-ci-invocation

Conversation

@renemadsen

Copy link
Copy Markdown
Member

eform-client/TESTING.md already documented npm run test:ci as the CI entry point. The workflows were the outlier, still calling test:unit. This aligns them and corrects the doc.

This is a consistency fix, not a performance or correctness one

I want to be explicit, because the obvious justifications for it are both wrong:

  • --ci changes nothing on GitHub Actions. Jest auto-detects CI via ci-info, which lists GITHUB_ACTIONS; jest --showConfig resolves ci: true on a runner without the flag. The snapshot-writing hole --ci would close is also empty here — the suite has 0 snapshots. The flag is kept only so the script stays correct anywhere detection does not fire.
  • --maxWorkers=2 buys nothing measurable, so it is dropped from test:ci. Benchmarked on a 4-CPU cgroup with a cold cache, two runs each: capped 239.7s vs default 240.1s — 0.16%, with the two modes trading places between runs. Peak RSS ~2.65 GB against 16 GB either way. It was an unexamined constant; removing it lets Jest scale to whatever runner the repo gets.

What was actually wrong

The docs and the workflow disagreed about how tests run in CI, and the docs were right. The doc also claimed a 2-worker cap that is now gone, and said nothing about these jobs not gating a merge.

TESTING.md's CI section now names the job and both workflow files, describes the worker behaviour accurately, and records that no required status checks are configured — so a failing Jest run does not by itself block a merge. (master does have rulesets — an org-level copilot_code_review on all refs, and a repo ruleset restricting deletion/non-fast-forward on refs/heads/stable — they simply carry no required_status_checks.)

Verified

35 tracked spec files, 147 tests, all passing, run as CI would (excluding the gitignored src/app/plugins/ dev-mode copies, which do not exist in a CI checkout).

Stale, and deliberately not touched here

The rest of TESTING.md is wrong in ways a consistency touch-up should not absorb:

  • The entire "Testing Patterns" section teaches Jasmine (jasmine.createSpyObj, jasmine.SpyObj). No spec in the repo uses it — 80 use jest.fn/jest.spyOn, and src/setup-jest.ts states outright that the Jasmine compatibility layer was removed. The documented pattern would not run.
  • "Common Issues" and "Debugging Tests" tell you to edit karma.conf.js and run ng test --source-map. Neither karma.conf.js nor src/test.ts exists.

That is a doc rewrite and deserves its own PR.

Related

While establishing the above I found that 60 unit spec files across 8 Angular plugin repos are executed by no pipeline at all — filed as #8044. That is the substantive version of "we have tests we do not run"; this PR is the small tidy-up next to it.

🤖 Generated with Claude Code

https://claude.ai/code/session_018qJL2WhHwhZ5CGZehZF2ro

`eform-client/TESTING.md` already documented `npm run test:ci` as what CI runs.
The workflows were the outlier, still calling `test:unit`. This aligns them.

Behaviourally this is close to neutral, and the doc now says so rather than
implying a benefit:

- `--ci` is redundant on GitHub Actions. Jest auto-detects CI via `ci-info`,
  which lists `GITHUB_ACTIONS`; `jest --showConfig` resolves `ci: true` on a
  runner without the flag. It is kept so the script stays correct anywhere
  detection does not fire.
- `--maxWorkers=2` is dropped from `test:ci`. It was an unexamined number, and
  it buys nothing measurable: benchmarked on a 4-CPU cgroup with a cold cache,
  capped 239.7s vs default 240.1s over two runs each, with the two modes
  trading places. Peak RSS ~2.65 GB against 16 GB either way. Removing it lets
  Jest scale to whatever runner the repo gets rather than pinning a constant
  nobody re-measured.

TESTING.md's CI section now names the job and both workflow files, states the
worker behaviour accurately, and records that these jobs are not required
status checks — so a failing Jest run does not by itself block a merge.

Not fixed here, but worth knowing: the rest of TESTING.md is stale in ways a
consistency touch-up should not absorb. Its entire "Testing Patterns" section
teaches Jasmine (`jasmine.createSpyObj`), which no spec in the repo uses and
`src/setup-jest.ts` explicitly says was removed; "Common Issues" and "Debugging
Tests" reference `karma.conf.js` and `src/test.ts`, neither of which exists.
That is a doc rewrite, not this change.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018qJL2WhHwhZ5CGZehZF2ro
Copilot AI lite review requested due to automatic review settings September 9, 2026 09:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The changes are low-risk consistency updates aligning workflows and documentation, with only minor doc maintainability nits noted.

Pull request overview

Aligns the CI Jest invocation with the documented test:ci entry point, and updates the testing documentation to reflect the CI job/script used.

Changes:

  • Switch GitHub Actions Jest steps from npm run test:unit to npm run test:ci.
  • Simplify test:ci by removing the explicit --maxWorkers=2 cap.
  • Update eform-client/TESTING.md CI section to name the relevant jobs/workflows and reflect current script behavior.
File summaries
File Description
eform-client/TESTING.md Updates the CI testing documentation to reference the actual workflows/job and the test:ci script behavior.
eform-client/package.json Removes the hardcoded Jest worker cap from test:ci.
.github/workflows/dotnet-core-pr.yml Runs the Jest CI script in the PR workflow.
.github/workflows/dotnet-core-master.yml Runs the Jest CI script in the master workflow.
Review details

Suppressed comments (1)

eform-client/TESTING.md:339

  • This statement depends on repository settings (required status checks) that can change independently of the code, so it can become outdated. Consider qualifying it with a time-bound phrasing (e.g., "At time of writing").
These jobs are not configured as required status checks, so a failing Jest run does not by itself
block a merge.
  • Files reviewed: 4/4 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread eform-client/TESTING.md
Comment on lines +334 to +336
- Jest's default worker count. There is no explicit `--maxWorkers` cap, so Jest scales to
whatever runner it gets (3 workers on the current 4-vCPU `ubuntu-latest` runner). Capping at 2
measured no faster on this suite, so there is no cap left to maintain.
@renemadsen
renemadsen merged commit 9839c71 into master Sep 9, 2026
31 of 35 checks passed
@renemadsen
renemadsen deleted the ci/jest-ci-invocation branch September 9, 2026 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants