Repository navigation
test(qa): pin the tautology CI job's annotation format and summary marker shape - #957
Merged
Merged
Conversation
…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"} -->
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.
Summary
Follow-up to #940/#955 closing test-coverage gaps identified in QA self-review after that PR merged:
::warningannotation format or theTAUTOLOGY_SUMMARYmarker's JSON shape — only live CI runs and manual verification covered them. A future refactor could silently break either with nothing going red.--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
emitGithubAnnotations,emitGithubStepSummary, andsummaryMarker(previously private) so tests can assert on their output directly, matching the existingselectChangedTestFilespattern in this file.scripts/qa/tautology-github-output.test.ts(unit): annotation format for tautological vs. non-tautological blocks, marker JSON shape (including thereasonfield), step-summary file writing, and the stdout fallback when$GITHUB_STEP_SUMMARYis unset.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_SUMMARYfile.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)
emitGithubAnnotations'sif (!block.isTautological) continuetoif (true) continue. "emits one ::warning line per tautological block, in workflow-command format" failed as expected; no other tests affected. Restored.emitGithubStepSummaryto 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 passnpm test— full suite: 270 files / 5523 tests passing (1 pre-existing expected fail, 2 pre-existing skips)References #940.
🤖 Generated with Claude Code