Skip to content

test: add real integration test and relabel run() orchestration suite#190

Merged
maximn merged 4 commits into
mainfrom
fix/163-clarify-orchestration-test
Jul 5, 2026
Merged

test: add real integration test and relabel run() orchestration suite#190
maximn merged 4 commits into
mainfrom
fix/163-clarify-orchestration-test

Conversation

@maximn

@maximn maximn commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Closes #163.

Problem

src/__tests__/index.test.ts vi.mocks @actions/core, node:fs, both parsers, the API client, and every util/output module — so it verifies run() orchestration with all collaborators stubbed, not real cross-module integration. Its top-level describe was nonetheless named run() integration, misrepresenting the test layer. True end-to-end coverage lived only in CI (.github/workflows/e2e.yml), never in the Vitest suite.

Changes

  • Relabel: rename the describe to run() orchestration (all collaborators mocked) and add a clarifying comment pointing at the real integration test. No assertion/behavior changes; FR5 setFailed-never invariants untouched.
  • New real integration testsrc/__tests__/index.integration.test.ts: drives the actual pipeline with zero mocks (discover → readFileSync → detect-format → parse → merge → detect-framework → generateSummary writing 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.
  • Testability: gate the module-load run() behind !process.env.VITEST so the entrypoint imports side-effect-free under the test runner. In the published dist/ bundle VITEST is never set, so the Action still runs on load.
  • Docs: retire known-issue F from .agents/known-issues.md and 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 — clean
  • dist/ untouched (CI-built, never committed)

maximn and others added 2 commits July 5, 2026 20:18
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.
@maximn maximn enabled auto-merge (squash) July 5, 2026 19:21
@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

maximn and others added 2 commits July 5, 2026 20:24
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).
@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

🔬 TestGlance

✅ 740 passed across 1 job — 100.0% · ⏱️ 3.0s

Job Result Pass rate Duration Health
test 740/740 · 100.0% → 3.0s ↓ 95 Run · Report
🟡 test — details

✅ 740 passed
████████████████ 100.0%
⏱️ 3.0s · 🏥 95/100
📈 Pass rate: 100.0% → (+0.0%) · Duration: 3.0s ↓ (262ms, -8.0%) · Tests: 740 (+0)

Signal Details
🟡 Duration +0.255% vs baseline (3.0s)
🔵 Health Score: 95 → 95

vs main

Metric main PR Delta
Pass rate 100.0% 100.0% +0.0%
Duration 2.4s 3.0s +25.1%

View Run → · 📄 HTML Report


Updated 2026-07-05T19:58:43.030Z

@maximn maximn merged commit 2fbaa13 into main Jul 5, 2026
7 checks passed
@maximn maximn deleted the fix/163-clarify-orchestration-test branch July 5, 2026 19:58
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.

Clarify that index.test.ts is an orchestration unit test, not integration

1 participant