Skip to content

ci: wire root scripts vitest suites into a real CI test target - #916

Merged
blove merged 1 commit into
mainfrom
blove/root-scripts-vitest-ci
Sep 1, 2026
Merged

ci: wire root scripts vitest suites into a real CI test target#916
blove merged 1 commit into
mainfrom
blove/root-scripts-vitest-ci

Conversation

@blove

@blove blove commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

The gap

Eight vitest spec files under root scripts/ — including the deployment-generator drift checks and framework-adapter branching specs from #894/#898 — were wired into no Nx target and run by nothing in CI. Only the node:test suites (ci-scope, ci-workflow, cockpit-matrix, cockpit-ports, verify-angular-support) were executed, via direct node --test steps in ci.yml.

Inventory (root scripts/.spec.)

Spec Runner Ran in CI before Runs now via
ci-scope.spec.mjs node:test yes (ci-scope job) unchanged
ci-workflow.spec.mjs node:test yes (ci-scope job) unchanged
cockpit-matrix.spec.mjs node:test yes (ci-scope job) unchanged
cockpit-ports.spec.mjs node:test yes (ci-scope job) unchanged
verify-angular-support.spec.mjs node:test yes (library job) unchanged
generate-ag-ui-deployment-config.spec.ts vitest no nx test scripts
generate-shared-deployment-config.spec.ts vitest no nx test scripts
ag-ui-proxy.spec.ts vitest no nx test scripts
langgraph-proxy.spec.ts vitest no nx test scripts
rate-limit.spec.ts vitest no nx test scripts
upstash-rate-limit.spec.ts vitest no nx test scripts
verify-release-versions.spec.mjs vitest no nx test scripts
mit-cutover.spec.mjs vitest no excluded — stale, see below

Wiring

  • New Nx project scripts (scripts/project.json) with an @nx/vitest:test target — same executor/config-file convention as the libs. scripts/vite.config.mts includes *.spec.{ts,mjs} and excludes the five node:test suites by name; a future node:test spec added without updating the exclude fails loudly under vitest instead of silently not running.
  • scope:scripts-tests tag + new scripts_tests key in scripts/ci-scope.mjs, so nx show projects --affected flips the scope whenever any file in scripts/ changes (verified with a probe commit: touching generate-ag-ui-deployment-config.tsscripts_tests=true).
  • New ci.yml job scripts-tests (npx nx test scripts), gated on push || scripts_tests == 'true', and wired into required-pr-checks (needs + RESULT/SCOPE env + require_scoped) so a red run blocks the required PR check.
  • Guard test added to ci-workflow.spec.mjs asserting the job, its scope gate, and its required-pr-checks wiring exist.

Mutation evidence

  • Mutated the generator's GENERATED header → nx test scripts exits 1 with the drift byte-equality + header specs failing (3 failed / 50 passed); restored → exit 0.
  • Deleted the npx nx test scripts step from ci.yml → node --test scripts/ci-workflow.spec.mjs goes red (runs the root scripts vitest suites when the scripts project is affected); restored → green.

Excluded: mit-cutover.spec.mjs (stale — needs a policy decision)

Never run since #881 landed it, and it now fails against main on two counts: it asserts libs/licensing no longer exists (it is tracked and consumed by Angular bundles), and it asserts zero tracked references to the excluded competitor (yesterday's Mastra runtime content and deployments/ag-ui-mastra/package-lock.json legitimately contain them). Excluded with a comment in vite.config.mts; reconcile the spec with current policy in a follow-up rather than weakening it silently here.

Verification

  • nx test scripts: 7 files / 53 tests green
  • All node:test suites green post-edit (ci-scope 68, ci-workflow 20, chat smoke 29)
  • nx test telemetry green; nx show projects intact after the graph split
  • Fresh worktree, single npm ci, no lockfile changes

🤖 Generated with Claude Code

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

vercel Bot commented Sep 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
threadplane Ready Ready Preview Sep 1, 2026 3:47am UTC

Request Review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Automated approval: this PR received an intelligent (AI) code review. See the review comments on this PR.

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Claude finished @blove's task in 0s —— View job


I'll analyze this and get back to you.

@blove
blove enabled auto-merge (squash) September 1, 2026 03:45
@blove
blove merged commit bdb547c into main Sep 1, 2026
65 checks passed
blove added a commit that referenced this pull request Sep 1, 2026
`cockpit/deep-agents/footprint.spec.ts` and
`libs/cockpit-docs/src/lib/docs-bundle.spec.ts` were executed by nothing: no
vitest project included the first, and `cockpit-docs` had no `test` target at
all. Both are wired in here, following #916 (give the orphan a target) and
#918 (glob out-of-project cockpit specs into `nx test cockpit`).

Wiring surfaced three further gaps, all fixed:

- `cockpit-docs` and `cockpit-registry` were both unreachable. `nx test` does
  not walk `^test`, and the `library` job runs a hardcoded LIBS list that
  excludes them, so cockpit-registry's three specs had never run either. The
  cockpit job now uses `nx run-many` over all three projects.
- The footprint specs resolved paths from `process.cwd()`, which under
  `nx test cockpit` is `apps/cockpit`. Left as-is they would have asserted
  against `apps/cockpit/cockpit/...` and passed vacuously. They now resolve
  from `import.meta.url`.
- `cockpit/<product>/*.spec.ts` sits outside every project root, so
  `nx affected` attributes it to the untagged `root` project and a PR touching
  only those specs skipped the job that runs them. ci-scope now maps them onto
  the cockpit scope by path.

The website `.mdx` assertions in all three footprint specs asserted the
five-segment docs shape #918 deleted — the one docs-links.ts records as having
"produced a URL that 404s for every product". They are removed, not weakened:
that coupling is a table checked against the website's real content tree by
apps/cockpit/src/lib/docs-links.spec.ts.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
blove added a commit that referenced this pull request Sep 1, 2026
`cockpit/deep-agents/footprint.spec.ts` and
`libs/cockpit-docs/src/lib/docs-bundle.spec.ts` were executed by nothing: no
vitest project included the first, and `cockpit-docs` had no `test` target at
all. Both are wired in here, following #916 (give the orphan a target) and
#918 (glob out-of-project cockpit specs into `nx test cockpit`).

Wiring surfaced three further gaps, all fixed:

- `cockpit-docs` and `cockpit-registry` were both unreachable. `nx test` does
  not walk `^test`, and the `library` job runs a hardcoded LIBS list that
  excludes them, so cockpit-registry's three specs had never run either. The
  cockpit job now uses `nx run-many` over all three projects.
- The footprint specs resolved paths from `process.cwd()`, which under
  `nx test cockpit` is `apps/cockpit`. Left as-is they would have asserted
  against `apps/cockpit/cockpit/...` and passed vacuously. They now resolve
  from `import.meta.url`.
- `cockpit/<product>/*.spec.ts` sits outside every project root, so
  `nx affected` attributes it to the untagged `root` project and a PR touching
  only those specs skipped the job that runs them. ci-scope now maps them onto
  the cockpit scope by path.

The website `.mdx` assertions in all three footprint specs asserted the
five-segment docs shape #918 deleted — the one docs-links.ts records as having
"produced a URL that 404s for every product". They are removed, not weakened:
that coupling is a table checked against the website's real content tree by
apps/cockpit/src/lib/docs-links.spec.ts.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
blove added a commit that referenced this pull request Sep 1, 2026
#936)

`cockpit/deep-agents/footprint.spec.ts` and
`libs/cockpit-docs/src/lib/docs-bundle.spec.ts` were executed by nothing: no
vitest project included the first, and `cockpit-docs` had no `test` target at
all. Both are wired in here, following #916 (give the orphan a target) and
#918 (glob out-of-project cockpit specs into `nx test cockpit`).

Wiring surfaced three further gaps, all fixed:

- `cockpit-docs` and `cockpit-registry` were both unreachable. `nx test` does
  not walk `^test`, and the `library` job runs a hardcoded LIBS list that
  excludes them, so cockpit-registry's three specs had never run either. The
  cockpit job now uses `nx run-many` over all three projects.
- The footprint specs resolved paths from `process.cwd()`, which under
  `nx test cockpit` is `apps/cockpit`. Left as-is they would have asserted
  against `apps/cockpit/cockpit/...` and passed vacuously. They now resolve
  from `import.meta.url`.
- `cockpit/<product>/*.spec.ts` sits outside every project root, so
  `nx affected` attributes it to the untagged `root` project and a PR touching
  only those specs skipped the job that runs them. ci-scope now maps them onto
  the cockpit scope by path.

The website `.mdx` assertions in all three footprint specs asserted the
five-segment docs shape #918 deleted — the one docs-links.ts records as having
"produced a URL that 404s for every product". They are removed, not weakened:
that coupling is a table checked against the website's real content tree by
apps/cockpit/src/lib/docs-links.spec.ts.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
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.

1 participant