Skip to content

test(qa): pin the tautology CI job's annotation format and summary marker shape - #957

Merged
admarble merged 1 commit into
mainfrom
chore/940-ac2-ac3-test-coverage
Aug 21, 2026
Merged

admarble merged 1 commit into
mainfrom
chore/940-ac2-ac3-test-coverage

Conversation

@admarble

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #940/#955 closing test-coverage gaps identified in QA self-review after that PR merged:

  • AC-2/AC-3 had no unit test pinning the ::warning annotation format or the TAUTOLOGY_SUMMARY marker's JSON shape — only live CI runs and manual verification covered them. A future refactor could silently break either with nothing going red.
  • The --github + zero-changed-test-files combination was never exercised on a real CLI invocation — every commit on feat(ci): run the tautology detector in CI — advisory, measured (#940) #955 happened to touch test files.

Changes

  • Exports emitGithubAnnotations, emitGithubStepSummary, and summaryMarker (previously private) so tests can assert on their output directly, matching the existing selectChangedTestFiles pattern in this file.
  • New scripts/qa/tautology-github-output.test.ts (unit): annotation format for tautological vs. non-tautological blocks, marker JSON shape (including the reason field), step-summary file writing, and the stdout fallback when $GITHUB_STEP_SUMMARY is unset.
  • New subprocess integration test in tautology-detector-cli.test.ts: runs the real CLI with --base HEAD --advisory --github (a deterministic zero-files diff — HEAD against itself) and asserts the skip message + marker land in a real $GITHUB_STEP_SUMMARY file.

No production behavior changes — this is test coverage only. selectChangedTestFiles, main(), and every existing code path are untouched except for the three functions changing from private to exported.

Mutation verification (AC-2, AC-3 — both gate tests)

  • AC-2: mutated emitGithubAnnotations's if (!block.isTautological) continue to if (true) continue. "emits one ::warning line per tautological block, in workflow-command format" failed as expected; no other tests affected. Restored.
  • AC-3: mutated emitGithubStepSummary to drop the marker from its body. Both step-summary unit tests and the new integration test failed as expected; no other tests affected. Restored.

Test plan

  • npm run build / npm run lint / npm run typecheck:scripts — all pass
  • npm test — full suite: 270 files / 5523 tests passing (1 pre-existing expected fail, 2 pre-existing skips)
  • New unit tests (6) and new integration test — all pass
  • Mutation-verified per above

References #940.

🤖 Generated with Claude Code

…rker shape (#940 follow-up)

#940/#955 shipped the tautology-advisory CI job, but nothing pinned
the ::warning annotation format, the TAUTOLOGY_SUMMARY marker's JSON
shape, or the --github + zero-changed-test-files combination — only
live CI runs and manual verification covered them, so a future
refactor of any of the three could silently break Phase A's FP-rate
accounting with no test going red.

- Export emitGithubAnnotations, emitGithubStepSummary, and
  summaryMarker (previously private) so their output can be asserted
  on directly.
- New unit tests (tautology-github-output.test.ts): annotation format
  for tautological vs. non-tautological blocks, marker JSON shape
  including the reason field, step-summary file writing, and the
  stdout fallback when $GITHUB_STEP_SUMMARY is unset.
- New subprocess integration test in tautology-detector-cli.test.ts:
  runs the real CLI with --base HEAD --advisory --github (deterministic
  zero-files diff) and asserts the skip message + marker land in a
  real $GITHUB_STEP_SUMMARY file — closes the "never exercised on a
  real CLI invocation" gap for that flag combination.

Mutation-verified: AC-2 (annotation format) — removed the
isTautological guard in emitGithubAnnotations (`if (true) continue`);
"emits one ::warning line per tautological block" failed as expected,
no other tests affected; restored.

Mutation-verified: AC-3 (summary marker) — dropped the marker from
emitGithubStepSummary's body; both step-summary unit tests and the new
integration test failed as expected, no other tests affected; restored.

<!-- SEQUANT_MUTATION: {"ac":"AC-2","mutation":"emitGithubAnnotations: if (!block.isTautological) continue -> if (true) continue","failedTest":"emits one ::warning line per tautological block, in workflow-command format"} -->
<!-- SEQUANT_MUTATION: {"ac":"AC-3","mutation":"emitGithubStepSummary: body includes marker -> body omits marker","failedTest":"--github with zero changed test files writes the skip summary and marker to $GITHUB_STEP_SUMMARY"} -->
@admarble
admarble merged commit 39a5fb7 into main Aug 21, 2026
6 checks passed
@admarble
admarble deleted the chore/940-ac2-ac3-test-coverage branch August 21, 2026 06:28
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