Repository navigation
test: drop the second copy of the mcp server glob-deny check - #39259
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the deleted test is the same as [DESIGN-REVIEWED] d31755a Description read[DESCRIPTION-READ] 1ddfd129da7d5624caacd3c3b0c1a8da22729839f6ab9a7f1c8be6ddb1200e7f That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
|
Backend Tests (3.12, 8) red is main's, not this PR's: test/test_bare_session_handle_guard.py::test_no_test_builds_a_bare_session_handle_directly fails on origin/main 640338a (flags test_kas_token_refresh_recovery.py:245, added in #38978). Tracked in #39261, fix in #39262. This PR waits for that fix, then rebases. |
TestInstallRows carried a byte-identical copy of TestUnknownValues' test_an_mcp_server_glob_deny_refuses_the_policy: the same input, the same pytest.raises(Unrepresentable) and the same module fixture, with no class fixture or mark of its own. The kept copy runs the same lines on the same platforms.
11a9150 to
d31755a
Compare
Code change approver recommendation: A person should decideWhy: the decider estimates a 3% chance that this change introduces a defect, within the 12% limit for approving on its own, but it is held at tier 2: reviewer-finding: Design Review. This PR deletes one test, Tier: 2, held for a person: reviewer-finding: Design Review. An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
This review checked head d31755a. The diff deletes 4 lines from one file, test/test_enterprise_policy_translate_terms.py. The deleted test is TestInstallRows::test_an_mcp_server_glob_deny_still_refuses_the_policy. The test that stays, TestUnknownValues::test_an_mcp_server_glob_deny_refuses_the_policy, has the same input and the same pytest.raises(t.Unrepresentable) check. Both run under the same module-level autouse enterprise fixture, so no check is lost. The server-glob check that the kept test pins in _mcp_patterns is still on main. Nothing outside this file names the removed test. No other open PR touches this file, and PR Readiness passed on this head.
Done well: the body proves the deletion is neutral instead of just saying so. It names the kept test as the Reader, plants an error in the production check, and compares coverage before and after.
Optional:
- The body says "3 lines" were removed. The diff also removes a trailing blank line, so it shows 4.
Problem / Motivation
Goal: Remove one byte-identical duplicate test from
test_enterprise_policy_translate_terms.pywith no loss of any check or covered line.TestInstallRows::test_an_mcp_server_glob_deny_still_refuses_the_policy, added with the install rows in #38471, is a copy ofTestUnknownValues::test_an_mcp_server_glob_deny_refuses_the_policy, added in #30856. Both tests:ast.dumpequal),rules:\n - {capability: mcp, effect: deny, match: ['corp-*/x']}\n,pytest.raises(t.Unrepresentable),enterprisefixture (EDITION = "lts").Neither class has a fixture,
setUp, mark or skip of its own. Neither test carries the file's_POSIX_PATHSskip, and neither is listed inwindows-collect-ignore.txtorwindows-expected-failures.txt. So the two run the same lines on the same platforms.Why it matters
scripts/find_duplicate_test_bodies.pycounts duplicate-body groups as a test-quality measure. This pair is the only group, among those new or grown sincec844e1e5e9, whose copies read the same data. Every other new pair parametrizes over different lists, takes a different fixture, or is a security suite kept per rule. After this change the count goes from 128 to 127 groups onorigin/main42d0d666e0.Not a goal
src/and no change totest/conftest.py.What changed (motivation → approach → change)
The copy in
TestInstallRowsis deleted, 3 lines.TestUnknownValues::test_an_mcp_server_glob_deny_refuses_the_policystays as it is.Backwards compatibility
Compatible: test-only.
Removes nothing: no checked behaviour is removed. The removed test's single check is made, with the same input and fixture, by the kept test.
Reader: test/test_enterprise_policy_translate_terms.py:TestUnknownValues.test_an_mcp_server_glob_deny_refuses_the_policy -- release -- the same check on the same input, still run
Tests
Proof: not provable -- test-only change
Why the deletion is safe:
ast.dump-equal, and the input, the check and the fixture are the same (see above).src/kiro_crew/platform/enterprise_policy_translate.pykeeps the kept test, and the file's other 168 tests.--cov=kiro_crew -n0:enterprise_policy_translate.py: 483 executed lines and 226 executed branches, before and after.any(c in server for c in "*?[")) from_mcp_patternsinenterprise_policy_translate.pymakest.translateaccept the glob deny. The keptTestUnknownValues::test_an_mcp_server_glob_deny_refuses_the_policythen fails withDID NOT RAISE: 1 failed, 168 passed. The plant was reverted from a copy.-n 4 --dist loadgroup, and 169 passed at-n0in reverse collection order.Manual verification
N/A — unit coverage sufficient: one duplicate test removed; the counts and coverage above are the verification.
Real-machine verification
N/A -- test-only change: removes a duplicate test; nothing new runs.
Related Issues
Duplicate-body follow-up to the 2026-11-18 count (128 groups on
0d68cae9e6).Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license; see the Licensing section of CONTRIBUTING.md.