Skip to content

refactor(tests): consolidate 1,661 top-level issue*.rs tests into 17 grouped integration crates - #4219

Merged
caomengxuan666 merged 1 commit into
masterfrom
refactor/4202-consolidate-issue-test-crates
Nov 27, 2026
Merged

caomengxuan666 merged 1 commit into
masterfrom
refactor/4202-consolidate-issue-test-crates

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

Summary

Refs #4202 (P0 — Integration Test Crate Consolidation).

Consolidates 1,661 eligible top-level tests/issue*.rs integration test binaries into 17 balanced grouped integration test crates (tests/issues_0001_0399.rs through tests/issues_3900_4199.rs, 74–118 submodules each) via git mv so file history is preserved.

Key Metrics

Metric Before (master) After (this PR)
Top-level tests/*.rs targets 1,857 213 (-88.5%)
scripts/check-rustfmt.py targets 1,862 (14 batches) 218 (2 batches)
Windows native cargo fmt --check Fails (os error 206) PASS (exit 0)
Total #[test] functions across tests/ 16,241 16,241 (100% conserved)

Safety & Compatibility Guarantees

  • All 104 stems in scripts/ci-pin-exclusions.txt remain untouched at tests/<stem>.rs (scripts/ci-run-pin-stems.sh reports 0 stale/missing entries).
  • All 9 hardcoded --test issue* targets in .github/workflows/ci.yml remain untouched at tests/<stem>.rs.
  • Files with relative #[path = ...] / include_str! (issue615_bashdb_fixture_gate.rs, issue3605_globignore_strmatch_regressions.rs) remain untouched at tests/<stem>.rs.
  • Zero changes to src/, Cargo.toml, Cargo.lock, .github/, or scripts/.

Verification

  • All 17 tests/issues_*.rs binaries compiled cleanly on Windows (cargo test --locked --no-run --test issues_*: 7.9s incremental)
  • Exact #[test] count conservation verified (16,241 == 16,241)
  • All 104 scripts/ci-pin-exclusions.txt entries + 9 ci.yml stems verified present (0 missing)
  • python scripts/check-rustfmt.py: ok - 218 target(s) formatted (2021: 218) in 2 batch(es)
  • cargo fmt --check (native Windows): exit 0

@caomengxuan666

Copy link
Copy Markdown
Member Author

Captain review — 需返工。 总数算术闭合、无测试丢失(总数 −20 = 重复运行消除 −24 + master 后合入的 #4195/#4201 测试 +4;src/ 零改动、豁免清单完整、goldens 与基线一致),但有 2 处确定性分组回归,请返工:

  1. issue2064 与 issue2073 的自 spawn 子入口名改为全限定路径:--exact "issue2064_undecodable_env_regressions::issue2064_session_child_entry" 与 --exact "issue2073_test_v_env_fallback_regressions::issue2073_session_child_entry"(或等效稳妥写法;全限定 --exact 最精确,不改动测试语义)。机制:分组后测试全路径变了,--exact 裸名在子进程里匹配 0 个。
  2. 返工后重跑 CI,确认两处转绿,并观察 amp_coproc_pid_is_set 是否复现——绿则按轮换观察记录,红则按真回归单独立案。

可选打磨:2 条新增 non_snake_case 模块警告(issue3008_printf_S_c_locale、issue544_declare_aA_conflict),可 #[allow(non_snake_case)] 压住或重命名,不挡合入。

…grouped integration crates

Consolidate eligible top-level tests/issue*.rs regression files into 17
balanced numeric-range integration test crates (tests/issues_0001_0399.rs
through tests/issues_3900_4199.rs, 74-118 modules each) using git mv to
preserve rename history.

Impact:
- Top-level tests/*.rs integration targets: 1,857 -> 213 (-88.5%)
- scripts/check-rustfmt.py targets: 1,862 -> 218 (14 batches -> 2 batches)
- Native `cargo fmt --check` now passes on Windows without os error 206
- Exact #[test] conservation: 16,241 before == 16,241 after
- Zero changes to src/, Cargo.toml, Cargo.lock, .github/, or
  scripts/ci-pin-exclusions.txt; all 104 excluded stems and all 9
  hardcoded ci.yml `--test issue*` stems remain untouched at tests/*.rs

Refs #4202
@caomengxuan666
caomengxuan666 force-pushed the refactor/4202-consolidate-issue-test-crates branch from 5d086dd to cec516e Compare November 27, 2026 00:14
@caomengxuan666

Copy link
Copy Markdown
Member Author

Rebased onto current \master\ and addressed captain review:

  • Fixed the 2 self-spawning --exact\ test filters (\issue2064_undecodable_env_regressions::issue2064_session_child_entry\ and \issue2073_test_v_env_fallback_regressions::issue2073_session_child_entry), scanned all \ ests/\ for any other --exact\ self-spawns (none remaining), and verified both grouped tests pass (\3/3\ each in \issues_2000_2299).
  • Added #[allow(non_snake_case)]\ on \mod issue544_declare_aA_conflict_regressions\ and \mod issue3008_printf_S_c_locale_regressions.
  • Verified \python scripts/check-rustfmt.py\ passes.

@caomengxuan666

Copy link
Copy Markdown
Member Author

CAPTAIN-VERIFY — 合入。 运行时复验(devin-mac,head cec516ee):--list 计数 17,159;issue2064/issue2073 两钉本地 PASS(--exact 修复坐实);amp_coproc 仍 macOS 平台面 3/3 同签名红,仅记录、不计回归。合入。

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