Skip to content

ci: 20 .test.cjs suites run in no known runner #3560

Open

Description

@eleshar

Summary

Found while wiring the #3552 guard: 20 .test.cjs files match no runner. Root Jest testMatch covers only .js/.mjs/.ts; nested jest runners use default match (no .cjs); only release-agent and prompt-engineer-agent run node --test (covering 6 of the 20).

Uncovered files (verified 2026-09-24: absent from root --listTests, no owning script found)

  • agents/changelog-agent/includes/tests/ (2)
  • agents/wordpress-release-utilities-agent/includes/tests/ (3)
  • scripts/automation/__tests__/update-projects-status.test.cjs
  • scripts/validation/__tests__/validate-labels-before-creation.test.cjs
  • scripts/workflows/changelog/__tests__/ (4: changelog-management, checkout-pr-head, merge-entries, merge-entries.integration)
  • scripts/workflows/metrics/__tests__/metrics-reporting.test.cjs
  • scripts/workflows/projects/__tests__/ (2)
  • scripts/workflows/release/__tests__/trigger-telemetry.test.cjs
  • scripts/workflows/__tests__/orchestrate-phase-progression.test.cjs

Covered elsewhere (no action): release-agent (6) and prompt-engineer-agent via package-local node --test.

Proposal

Decide per file: migrate to .test.js under root Jest, or wire the owning package's runner into CI. The #3552 wiring guard (scripts/validation/__tests__/test-wiring.test.js) explicitly scopes .cjs out until this is decided, so the gap stays visible instead of silently absorbed.

Acceptance

  • Every file above either runs in a gated runner or is deleted/moved with reason

Activity

  1. linear-code commented on Sep 24, 2026

    @linear-code
  2. eleshar commented on Oct 1, 2026

    @eleshar
    ContributorAuthor

    Re-measured on develop at cb955e47dd, each of the 20 tracked *.test.cjs files in its own Jest process.

    3 pass · 16 fail · 1 kills the runner with no summary. 19 failed / 99 passed / 118 total.

    Full per-suite table and the two additional defects are in #3484. Three findings bear directly on this issue's proposal:

    1. The proposal's two options do not resolve this. Migrating to .test.js does not help a suite that fails at module load before registering a test, and 11 of the 16 failures are exactly that. Wiring a package-local node --test runner does not help a file that calls process.exit() mid-run, which is what merge-entries.test.cjs does at line 223. Both of those need the suite fixed first. Neither option is blocked by runner availability.

    2. testMatch alone is not the whole fix. .jest.config.cjs's transform pattern '^.+\\.(js|mjs|ts|tsx|jsx)?$' does not include cjs, so these files are not transformed even once matched. Anything that widens the runner has to widen that too.

    3. The coverage claim in this issue still holds. The 20 files are still absent from root --listTests, and release-agent and prompt-engineer-agent still cover 6 of them via node --test. Nothing here has changed that.

    Proposed duplicate

    Proposing #3484 wins and this one closes as the duplicate. #3484 states the defect precisely, carries a testable acceptance criterion ("--listTests includes every tracked *.test.cjs, and all of them pass"), and now holds the per-suite measurement. This issue frames the same 20 files from the runner-ownership angle and proposes an approach this measurement shows is premature.

    I am not closing either issue — the choice is the maintainer's.

  3. eleshar commented on Oct 3, 2026

    @eleshar
    ContributorAuthor

    Context from #3711 (merged as 907442298): before it, bare npx jest found no configuration and fell back to Jest's built-in defaults, which did match the 20 *.test.cjs suites. With the new root jest.config.cjs forwarding to .jest.config.cjs, bare Jest now discovers exactly what the intended configuration does, and that configuration's testMatch does not include .cjs test files. So these suites are still not run by npm test, and bare Jest no longer picks them up either. This issue is unchanged: they still need a decision to be included in testMatch (and the failing ones fixed) or run by their own runner.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions