test: run the real code instead of hand-copied mirrors (sable-1drb) - #229
Merged
Conversation
The action's threshold-eval and PR-comment-tip tests each carried their own transcription of the bash they tested, so they could pass in full while action.yml was broken. The logic now lives once in github-action/lib/severity.sh, sourced by both action.yml steps and by both tests. Behaviour unchanged. A new end-to-end job runs the real action with findings above the threshold and asserts status=completed AND outcome=failure, which proves the counts reach the gate; drift check 17 asserts action.yml sources the library in both steps and carries no inline copy, so the tests cannot be silently detached again. node/tests/issues.test.ts mirrored four modules (dedup, issue-builder, from-text, from-scan) and tested the mirrors; one had already drifted. The copies are removed and every describe imports the shipped function. Three source functions gained `export` for that. Every guard was mutated by hand: each mutation fails named tests that were untouched by the same mutation before this change.
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.
Third and final home for sable-1drb. Originally #225, which I closed by accident when I merged #224 with
--delete-branch— deleting that branch closed the PR stacked on it, and GitHub will not reopen a PR whose base ref is gone. #228 was the retarget attempt, but its branch still carried #224's pre-squash commit and conflicted with main. This is that same commit rebased cleanly onto main, single commit, no conflicts. No code changed across any of the three.What this does
Deletes the hand-copied test mirrors and runs the real implementations instead. The bash tests now
sourcethe samelib/severity.shthataction.ymlsources, rather than asserting against a transcribed copy of it.Coverage is provably unchanged
The diff removes 324 lines, which is where coverage tends to vanish quietly, so it was measured rather than assumed.
node/tests/issues.test.tsbefore vs after:it()96 to 96,describe()25 to 25,expect()159 to 159, and acommover the sorted test titles is empty on both sides — not one title added, dropped or renamed. Every deletion is a mirrored implementation ofdedup,issue-builder,from-textordraftsFromLocalScan; all four imported symbols are real exports.The gates were mutation-tested rather than read: breaking the
higharm ofseverity.shproduced three named failures, and check 17 correctly failed when bothsourcelines were stripped.test-threshold-gate-end-to-endsupplies the wiring proof a unit test cannot.Known follow-up, filed separately
rafter_threshold_failstreats an empty or non-numeric count as zero findings and passes the build — verified by execution for every threshold. That is pre-existing behavior this PR relocates rather than introduces, tracked as its own bead along with retargeting the severity-gateif:fromsteps.poll.outputs.statustosteps.results.outputs.status.Follows #224.