Skip to content

test: remove 6 duplicate permission validation tests in compiler_tests#765

Merged
jamesadevine merged 1 commit into
mainfrom
test-reducer/remove-duplicate-permission-tests-7a66cc3063424d74
May 27, 2026
Merged

test: remove 6 duplicate permission validation tests in compiler_tests#765
jamesadevine merged 1 commit into
mainfrom
test-reducer/remove-duplicate-permission-tests-7a66cc3063424d74

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Test Suite Reduction: tests/compiler_tests.rs

What was wrong

The generic permission validation tests test_permissions_validation_fails_without_write_sc and test_permissions_validation_passes_with_write_sc already verify the compiler's behavior for all write-requiring safe-outputs:

  1. Compilation fails when a write-requiring safe-output is used without a write service connection
  2. Compilation succeeds when a write service connection is provided

Six additional tests duplicated this exact validation for specific safe-outputs (update-wiki-page, create-wiki-page, update-work-item). These tests only changed which safe-output was used in the front matter — they provided no additional coverage of unique behavior.

Changes

Test Action Reason
test_update_wiki_page_requires_write_sc Removed Duplicate of test_permissions_validation_fails_without_write_sc
test_update_wiki_page_compiles_with_write_sc Removed Duplicate of test_permissions_validation_passes_with_write_sc
test_create_wiki_page_requires_write_sc Removed Duplicate of test_permissions_validation_fails_without_write_sc
test_create_wiki_page_compiles_with_write_sc Removed Duplicate of test_permissions_validation_passes_with_write_sc
test_update_work_item_requires_write_sc Removed Duplicate of test_permissions_validation_fails_without_write_sc
test_update_work_item_compiles_with_write_sc Removed Duplicate of test_permissions_validation_passes_with_write_sc

Verification

  • cargo test --test compiler_tests: all 108 tests pass ✅
  • cargo clippy --all-targets --all-features: no warnings ✅

Impact

  • 305 lines removed
  • 6 tests removed (reduced from 114 to 108 tests in compiler_tests.rs)
  • 0 functional coverage lost — the generic tests remain and provide identical validation

Generated by Test Reducer · ● 1.6M ·

The generic tests test_permissions_validation_fails_without_write_sc and
test_permissions_validation_passes_with_write_sc already verify that:
1. Safe-outputs requiring write permissions fail compilation without write SC
2. Safe-outputs requiring write permissions succeed with write SC

Removed 6 redundant tests that duplicate this validation for specific
safe-outputs (update-wiki-page, create-wiki-page, update-work-item).
These specific tests added no unique coverage - they only changed which
safe-output was used in the front matter, but tested the exact same
compiler validation logic.

Tests removed:
- test_update_wiki_page_requires_write_sc
- test_update_wiki_page_compiles_with_write_sc
- test_create_wiki_page_requires_write_sc
- test_create_wiki_page_compiles_with_write_sc
- test_update_work_item_requires_write_sc
- test_update_work_item_compiles_with_write_sc

Verification:
- cargo test --test compiler_tests: all 108 tests pass ✅
- cargo clippy --all-targets --all-features: no warnings ✅

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jamesadevine jamesadevine marked this pull request as ready for review May 27, 2026 05:35
@jamesadevine jamesadevine merged commit 3b7dc97 into main May 27, 2026
@jamesadevine jamesadevine deleted the test-reducer/remove-duplicate-permission-tests-7a66cc3063424d74 branch May 27, 2026 05:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant