Repository navigation
test: prune redundant and implementation-mirroring tests - #1026
Conversation
Remove tests that repeat coverage held at another layer (agent/CLI surface parity, driver service, unit tests), lock help text or removed-flag history, hard-code fixture-derived counts, or need test-only production state. Terminal snapshots keep one 100-column no-color variant per command; width and color behavior stay covered by their dedicated tests. Probe-vs-capture comparisons run once, in the driver suite.
Second pass over the driver, analyzer, and LSP suites. Remove service tests already covered by agent/CLI surface parity, smoke tests that only assert Ok, unit tests repeated by an integration test of the same claim, and CLI copies of driver lint-package and lookup behavior. Fold seven pass-through provider-failure tests into one table-driven test.
|
Review verdict: CHANGES REQUESTED Reviewed head 1.
|
…-limit Pin code and exit for each LintPackageError variant on the CLI surface in one table test, and restore one wright lookup --limit range case next to the lookup --only test.
|
Review round 1 fixes are pushed in 1.
|
| Case | Code | Exit |
|---|---|---|
install gitlab.com/community/rules |
lint-package-source (USAGE package-install) |
2 |
install with a malformed package |
lint-package-invalid |
1 |
install against a 404 server |
lint-package-not-found |
4 |
search against a rate-limited server |
lint-package-rate-limited |
4 |
Mutation M1 (crates/wright-driver/src/lint_package.rs:634 Self::Source(_) => ExitClass::Usage → ExitClass::Internal): the test FAILS with lint-package-source: exit 4.
2. wright lookup --limit
crates/wright-cli/tests/selector_vocabulary.rs::lookup_rejects_an_out_of_range_limit runs lookup wait --limit 0 -f json and asserts exit 1 with error.code == "malformed-request". The test sits next to lookup_only_filters_entries_by_kind. The size-guard hook rejects any growth of cli.rs because the file is over its limit, so the test does not go there.
Mutation M2 (crates/wright-cli/src/main.rs:496 limit: args.limit → limit: None): the test FAILS with exit Some(0), expected Some(1).
Gates (local)
cargo fmt --all -- --check, cargo clippy --workspace --all-targets --all-features -- -D warnings, cargo test --workspace --all-targets --all-features, and git diff --check all pass. I reverted both mutations, and the commit does not contain them.
Summary
Audit of the Wright test suite under
docs/testing-policy.md: remove tests with no distinct durable claim. No production behavior changes.#[test]functions, 85 → 40 snapshots, about 5,100 lines removed.agent_contract_surface_parity(CLI JSON == agent result), plain/terminal snapshots, driver service tests,present.rs/agent.rs/agenttools.rsunits.athena_version == "0.11.0",emittedBytes=3960).wright-driver/tests/simulate.rs).wright-analyzer.#[cfg(test)]spinner frame counter inpresent.rs.session_query_workflows_…,tool_service_routes_…) or that only assertOk.provider_failures_keep_their_code_stage_and_exit_class.edit.rs,cache.rs,input.rs,wright-lspcapability advertisement).check --jsonschema snapshot (CODEOWNERS file unchanged).Test plan
cargo fmt --all -- --checkcargo clippy --workspace --all-targets --all-features -- -D warningscargo test --workspace --all-targets --all-features --no-fail-fast: all binaries passgit diff --checktests/fixturesbecame unreferenced