Repository navigation
test(linux): assert reservation failure and empty-reservation cleanup paths - #331
Merged
Merged
Conversation
… paths #330 reserves the screenshot name as an empty file before capture and removes it from an EXIT trap when the capture fails. Two of its arms had no asserting test: the die when the reservation itself cannot be made (the only uncovered line in hotshot-capture.sh), and the trap dropping the 0-byte reservation after maim fails or slurp is cancelled. Dropping either arm now fails the suite instead of passing; the unwritable-dir runs are bounded by timeout so a regression that keeps probing -N names fails rather than hangs CI. Lifts hotshot-capture.sh shell coverage from 99% (201/202) to 100%. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Contributor
Author
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
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.
Test Improvement
#330 made
unique_shot_pathreserve the screenshot name as an empty file (noclobber) before the capture tool runs, and added anEXITtrap that removes the 0-byte reservation when the capture fails. Two arms of that change shipped without an asserting test:return 1/die "cannot reserve a screenshot file in …"arm when the reservation fails for a reason other than "name taken" —hotshot-capture.sh:162was the only linescripts/shell-coverage.shreported uncovered at7f4a1ba(99%, 201/202);maimfails orslurpis cancelled — the existing "capture failure" and "cancelled slurp" cases asserted exit 1 and "nothing typed" but not that no 0-byte PNG is left behind.This adds unit assertions for the unwritable-directory reservation failure, an e2e run against a read-only shot dir asserting the die message, and "empty reservation removed" assertions on the two existing failure cases. Removing either arm from the script fails 5 of the new assertions (verified by mutation locally); the unwritable-dir runs are bounded by
timeoutso a regression that keeps probing-Nnames fails instead of hanging CI. Root (which ignores mode bits) skips the chmod-based cases explicitly rather than hanging.Shell coverage:
linux/hotshot-capture.sh99% → 100% (202/202); all 294 assertions pass locally.Filed by quality agent (ACMM L4/L6 — full mode)
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88