Skip to content

chore(core): remove orphaned, never-compiled test files#437

Merged
cryptskii merged 2 commits into
mainfrom
chore/core-remove-orphan-test-files
Jun 10, 2026
Merged

chore(core): remove orphaned, never-compiled test files#437
cryptskii merged 2 commits into
mainfrom
chore/core-remove-orphan-test-files

Conversation

@dsmfa10

@dsmfa10 dsmfa10 commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

Problem

Two test files are not declared by any mod, so the compiler never built or ran
them. They are dead weight and, worse, both contain code that would not even
compile if wired in (giving a false sense of test coverage):

  1. src/core/token/policy/policy_validation/complexity_tests.rs

    • No mod complexity_tests; exists anywhere (policy_validation.rs declares
      only mod tests). Confirmed via workspace grep.
    • Its assertions check for a warning substring ("exceeds 80%") that the code
      no longer emits (policy_validation.rs emits "over 80% of limit"), so the
      tests would fail if ever compiled.
  2. src/cpta/tests/mod.rs + src/cpta/tests/policy_tests.rs

    • cpta/mod.rs never declares mod tests, so the whole tests/ directory is
      orphaned.
    • policy_tests.rs constructs PolicyRole.permissions / OperationRestriction. allowed_operations (both Vec<String>) with Operation enum values, and
      asserts the wrong error variant — it would not compile / would fail.

Fix

git rm the three orphaned files. No mounted module references them.

Verification

cargo check -p dsm is unchanged (the files were never part of the build).

CI gates & coverage

Full verification for this PR runs in CI — Rust (cargo fmt --check,
clippy -D warnings, workspace tests), Frontend, Android Unit Tests,
Coverage, SPDX headers, CodeQL (see the PR's Checks tab). The local
check noted above is a subset; the broader mandated gates (full workspace test
suite, codegen/scan, Android, Frontend) run in CI, not locally — none is
silently skipped.

Two test files are not declared by any `mod`, so they were never compiled
and never run:
- `core/token/policy/policy_validation/complexity_tests.rs` (no
  `mod complexity_tests;` anywhere; `policy_validation.rs` declares only
  `mod tests`). Its assertions also reference a warning substring the code
  no longer emits, so it would fail if ever wired in.
- `cpta/tests/` (`mod.rs` + `policy_tests.rs`): `cpta/mod.rs` never declares
  `mod tests`, and `policy_tests.rs` constructs types with the wrong field
  types (would not compile).

Remove the dead files. No mounted module references them, so the build is
unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@cryptskii cryptskii merged commit b54356d into main Jun 10, 2026
8 of 9 checks passed
@cryptskii cryptskii deleted the chore/core-remove-orphan-test-files branch June 10, 2026 08:33
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.

3 participants