Skip to content

test: run the real code instead of hand-copied mirrors (sable-1drb) - #229

Merged
Rome-1 merged 1 commit into
mainfrom
fix/sable-1drb-rebased-onto-main
Sep 2, 2026
Merged

test: run the real code instead of hand-copied mirrors (sable-1drb)#229
Rome-1 merged 1 commit into
mainfrom
fix/sable-1drb-rebased-onto-main

Conversation

@Rome-1

@Rome-1 Rome-1 commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

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 source the same lib/severity.sh that action.yml sources, 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.ts before vs after: it() 96 to 96, describe() 25 to 25, expect() 159 to 159, and a comm over the sorted test titles is empty on both sides — not one title added, dropped or renamed. Every deletion is a mirrored implementation of dedup, issue-builder, from-text or draftsFromLocalScan; all four imported symbols are real exports.

The gates were mutation-tested rather than read: breaking the high arm of severity.sh produced three named failures, and check 17 correctly failed when both source lines were stripped. test-threshold-gate-end-to-end supplies the wiring proof a unit test cannot.

Known follow-up, filed separately

rafter_threshold_fails treats 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-gate if: from steps.poll.outputs.status to steps.results.outputs.status.

Follows #224.

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.
@Rome-1
Rome-1 merged commit 1ee4d26 into main Sep 2, 2026
22 checks passed
@Rome-1
Rome-1 deleted the fix/sable-1drb-rebased-onto-main branch September 2, 2026 21:49
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