test: fix incorrect and vacuous tests in create_git_tag and create_issue#838
Merged
jamesadevine merged 1 commit intoJun 3, 2026
Conversation
- create_git_tag.rs: rename test_validation_rejects_empty_tag to test_validation_rejects_too_short_tag — body uses "ab" (2 chars), not an empty string; the name was incorrect. - create_issue.rs: remove test_result_requires_write — it contained only a const assertion (always passes at runtime, vacuous). - mod.rs: add CreateIssueResult to the centralized test_requires_write_consistency so the REQUIRES_WRITE invariant is actually guarded alongside every other write-requiring tool. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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 Suite Reduction:
src/safeoutputs/create_git_tag.rs+src/safeoutputs/create_issue.rsWhat was wrong
test_validation_rejects_empty_tag(create_git_tag.rs): The test name claims it verifies rejection of an empty tag name, but the body supplies"ab"(a 2-character string). The code path being exercised is the "too short" validation (tag_name.len() >= 3), not the empty-string case. This is an incorrect test — name describes feature A, body exercises feature B.test_result_requires_write(create_issue.rs): The entire body isconst _: () = assert!(CreateIssueResult::REQUIRES_WRITE). This is a compile-time constant assertion that always evaluates toassert!(true)at runtime — completely vacuous as a test. Additionally,CreateIssueResultwas the only write-requiring tool not listed in the centralizedtest_requires_write_consistencyguard inmod.rs.Changes
create_git_tag.rstest_validation_rejects_empty_tagtest_validation_rejects_too_short_tagcreate_issue.rstest_result_requires_writemod.rstest_requires_write_consistencyCreateIssueResultentryREQUIRES_WRITEinvariant is centrally guardedVerification
cargo test: 1759 unit tests + all integration tests pass ✅Warning
Firewall blocked 2 domains
The following domains were blocked by the firewall during workflow execution:
spsprodeus21.vssps.visualstudio.comspsprodweu4.vssps.visualstudio.comSee Network Configuration for more information.