Skip to content

fix: plan worker-admission test for its source file - #1751

Merged
bcdonadio merged 1 commit into
mainfrom
fix/1720-ci-plan-worker-admission
Oct 25, 2026
Merged

bcdonadio merged 1 commit into
mainfrom
fix/1720-ci-plan-worker-admission

Conversation

@bcdonadio

Copy link
Copy Markdown
Contributor

Closes #1720

Why

test/surface-parity/worker-admission.test.ts reads test/postgresql/surface-parity.integration.ts from disk, extracts FixedBackendWorker and its helpers through the TypeScript AST, and evaluates them in a vm context. Vitest's module graph never sees that dependency and scripts/ci-plan.mjs did not list it, so a pull request touching only the integration file did not run the worker-admission test in the selective plan. A breakage (for example a new import that the vm context cannot resolve) only surfaced in the complete run on main. This was found while reviewing #1623.

How

  • Add an extracted-sources entry to GRAPH_INVISIBLE_INPUTS, after compiled-sources, mapping test/postgresql/surface-parity.integration.ts to test/surface-parity/worker-admission.test.ts. The existing index-based assertions only reference the first two entries, so they keep their meaning.
  • test/scripts/ci-plan.test.ts: assert the mapping in graphInvisibleTests (plus a non-matching sibling path), assert that classifyChanges for that path alone is selective with the worker-admission test in alwaysRun, and add an extracted-sources reader regex to the completeness table so any test that reads a postgresql/*.ts source via new URL(...) must be listed under the entry.

The path also matches the PostgreSQL path patterns, so the PostgreSQL job already ran for it; this only adds the unit test file. No production TypeScript changes, so no coverage fragment, changeset, or docs change.

Testing

  • vitest run test/scripts/ci-plan.test.ts test/surface-parity/worker-admission.test.ts: 2 files, 21 tests pass.
  • Negative control: with the worker-admission test temporarily removed from the new entry's tests, the completeness test fails with extracted-sources: expected [ 'test/surface-parity/worker-admission.test.ts' ] to deeply equal []. The temporary state was restored and is not part of the commit.
  • tsc --noEmit -p . and eslint on the two changed files pass.

Reviewer guide

Start with the new entry in scripts/ci-plan.mjs, then the three additions in test/scripts/ci-plan.test.ts. The completeness check proves only that a reading test is listed; a new disk-read source still needs its own pattern and entry (noted in a comment).

worker-admission.test.ts reads test/postgresql/surface-parity.
integration.ts from disk and evaluates extracted declarations in a vm
context. Vitest's module graph cannot see that dependency, so a pull
request touching only the integration file skipped the test in the
selective CI plan and the breakage surfaced only on main.

Add an extracted-sources entry to GRAPH_INVISIBLE_INPUTS, appended last
so index-based assertions keep their meaning, and cover it in the
classification cases. A matching reader regex joins the completeness
table so any test that reads a postgresql/*.ts source via new URL must
be listed under the entry.

The completeness check only proves a reading test is listed; a new
disk-read source still needs its own pattern and entry. The path also
matches the PostgreSQL job patterns, so only the unit test is added.

Closes #1720

Signed-off-by: Bernardo Donadio <bcdonadio@bcdonadio.com>
@bcdonadio bcdonadio self-assigned this Oct 25, 2026
@bcdonadio
bcdonadio enabled auto-merge October 25, 2026 06:13
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-25T06:14:14.488677Z e2b780d PR opened
🔒 Security Review ✅ Completed 2026-10-25T06:15:28.620584Z e2b780d PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@bcdonadio
bcdonadio merged commit 109a2e6 into main Oct 25, 2026
23 checks passed
@bcdonadio
bcdonadio deleted the fix/1720-ci-plan-worker-admission branch October 25, 2026 06:18
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.

CI plan misses worker-admission test when surface-parity integration file changes

1 participant