Skip to content

test: fix incorrect and vacuous tests in create_git_tag and create_issue#838

Merged
jamesadevine merged 1 commit into
mainfrom
test-reducer/create-git-tag-create-issue-fixes-0040b52e696f4f2b
Jun 3, 2026
Merged

test: fix incorrect and vacuous tests in create_git_tag and create_issue#838
jamesadevine merged 1 commit into
mainfrom
test-reducer/create-git-tag-create-issue-fixes-0040b52e696f4f2b

Conversation

@github-actions

@github-actions github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Test Suite Reduction: src/safeoutputs/create_git_tag.rs + src/safeoutputs/create_issue.rs

What 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 is const _: () = assert!(CreateIssueResult::REQUIRES_WRITE). This is a compile-time constant assertion that always evaluates to assert!(true) at runtime — completely vacuous as a test. Additionally, CreateIssueResult was the only write-requiring tool not listed in the centralized test_requires_write_consistency guard in mod.rs.

Changes

File Test Action Reason
create_git_tag.rs test_validation_rejects_empty_tag Renamed → test_validation_rejects_too_short_tag Name was incorrect — body tests 2-char input, not empty
create_issue.rs test_result_requires_write Removed Vacuous: const assert always passes at runtime
mod.rs test_requires_write_consistency Added CreateIssueResult entry Ensures the REQUIRES_WRITE invariant is centrally guarded

Verification

  • cargo test: 1759 unit tests + all integration tests pass ✅
  • No regressions introduced ✅

Warning

Firewall blocked 2 domains

The following domains were blocked by the firewall during workflow execution:

  • spsprodeus21.vssps.visualstudio.com
  • spsprodweu4.vssps.visualstudio.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "spsprodeus21.vssps.visualstudio.com"
    - "spsprodweu4.vssps.visualstudio.com"

See Network Configuration for more information.

Generated by Test Reducer · sonnet46 1.9M ·

- 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>
@jamesadevine jamesadevine marked this pull request as ready for review June 3, 2026 07:51
@jamesadevine jamesadevine merged commit 74fe82c into main Jun 3, 2026
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