test: add real integration test and relabel run() orchestration suite#190
Merged
Conversation
Closes #163. `src/__tests__/index.test.ts` mocks every collaborator, so it verifies run() orchestration, not real module integration. Its top-level describe called itself "run() integration", misrepresenting the layer. - Rename the describe to "run() orchestration (all collaborators mocked)" and add a clarifying comment pointing at the real integration test. - Add `src/__tests__/index.integration.test.ts`: an unmocked, offline end-to-end run of the pipeline (discover → parse → merge → summary) against committed JUnit and CTRF fixtures, asserting the recounted totals reach the CI job summary. - Gate the module-load `run()` behind `!process.env.VITEST` so the entrypoint can be imported side-effect-free under the test runner. - Retire known-issue F and reconcile the .agents/ docs.
Contributor
Contributor
Prettier flagged .agents/known-issues.md (unnormalized table column padding), failing the Lint & Format CI job. Reformat it, and update the index.test.ts:NNN line references in the .agents/ docs to match the current file (auto-run gate switched to TESTGLANCE_SKIP_AUTO_RUN).
Contributor
🔬 TestGlance✅ 740 passed across 1 job — 100.0% · ⏱️ 3.0s
🟡 test — details✅ 740 passed
vs
Updated 2026-07-05T19:58:43.030Z |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #163.
Problem
src/__tests__/index.test.tsvi.mocks@actions/core,node:fs, both parsers, the API client, and every util/output module — so it verifiesrun()orchestration with all collaborators stubbed, not real cross-module integration. Its top-leveldescribewas nonetheless namedrun() integration, misrepresenting the test layer. True end-to-end coverage lived only in CI (.github/workflows/e2e.yml), never in the Vitest suite.Changes
run() orchestration (all collaborators mocked)and add a clarifying comment pointing at the real integration test. No assertion/behavior changes; FR5setFailed-never invariants untouched.src/__tests__/index.integration.test.ts: drives the actual pipeline with zero mocks (discover →readFileSync→ detect-format → parse → merge → detect-framework →generateSummarywriting to a temp CI summary file), asserting the recounted totals against committed JUnit and CTRF fixtures. Kept offline via local-only mode (no api-key), history disabled, and no github-token.run()behind!process.env.VITESTso the entrypoint imports side-effect-free under the test runner. In the publisheddist/bundleVITESTis never set, so the Action still runs on load..agents/known-issues.mdand reconcile wording + line references in.agents/testing.md,conventions.md,observability.md.Verification
pnpm test— 739 passed (incl. 2 new integration cases)pnpm typecheck,pnpm lint,pnpm format:check— cleandist/untouched (CI-built, never committed)