Keep same-named Cargo integration test results separate #3367

Merged
leonida/mandy
merzleckeier merged 3 commits from github-pr/3367 into main 2026-12-03 22:47:13 +00:00

Pull request successfully merged and closed

merzleckeier commented 2026-12-03 16:33:34 +00:00

Claimed in #3312 as TEST-RED-GREEN-CARGO-TARGET-IDENTITY.

What and why

Two Cargo integration targets named smoke can both report a test named shared. The current checker uses smoke::shared for both, so a later pass can overwrite an earlier failure and produce a false red then green.

Use Cargo’s compiler-artifact metadata to identify each integration target by its workspace-relative package and target name. Keep the existing unit-test and doctest labels. This touches the same parser as #3307, which handles interrupted targets.

Tested

  • The synthetic regression fails on 717b90233, where the report loses the failing crate. It passes with this change.
  • With real Cargo 1.97.1 and two synthetic crates switching their statuses in opposite directions, the report lists both changes and returns green fails.
  • python3 -I tests/test_red_green.py ran 46 tests, with 45 passes and one Windows-only skip. The clean-room scan and git diff --check passed.
  • Separate read-only review by GPT-6.2 Sol verified the regression, simulated Windows paths, and checked real Cargo unit tests, doctests and compiler diagnostics.

GPUs tested: n/a.

AI-assisted with OpenAI Codex (GPT-6 family).

Claimed in [#3312](https://github.com/ProjectLeonida/mandy/issues/3312#issuecomment-7384889946) as `TEST-RED-GREEN-CARGO-TARGET-IDENTITY`. ### What and why Two Cargo integration targets named `smoke` can both report a test named `shared`. The current checker uses `smoke::shared` for both, so a later pass can overwrite an earlier failure and produce a false `red then green`. Use Cargo’s compiler-artifact metadata to identify each integration target by its workspace-relative package and target name. Keep the existing unit-test and doctest labels. This touches the same parser as #3307, which handles interrupted targets. ### Tested - The synthetic regression fails on `717b90233`, where the report loses the failing crate. It passes with this change. - With real Cargo 1.97.1 and two synthetic crates switching their statuses in opposite directions, the report lists both changes and returns `green fails`. - `python3 -I tests/test_red_green.py` ran 46 tests, with 45 passes and one Windows-only skip. The clean-room scan and `git diff --check` passed. - Separate read-only review by GPT-6.2 Sol verified the regression, simulated Windows paths, and checked real Cargo unit tests, doctests and compiler diagnostics. GPUs tested: n/a. AI-assisted with OpenAI Codex (GPT-6 family).
Kal0s-design commented 2026-12-03 17:03:50 +00:00

Ran natively on Windows 11 (Python 3.11), head bc00d02dc merged into current main (fba6f09ce, clean merge).

No findings. This covers the Windows-only part your run skipped.

run result
python -I tests/test_red_green.py, merge 46 tests, OK, none skipped (the job-object test runs here)
same, scripts/red_green.py from main, PR's tests 1 failure: test_same_named_cargo_integration_targets_keep_separate_results

Windows paths (measured). The label comes from Path(manifest_path).parent.relative_to(tree / "d3d12"). With cargo metadata on this checkout, all 8 integration test targets resolve under the workspace. A drive letter or folder name in a different case still resolves (C: vs c:, D3D12 vs d3d12). A \?\ verbatim manifest path doesn't, and falls back to the old name-hash label without an error. Cargo doesn't report paths that way here, so that's only a note.

Read, not run: the artifact scan stops at the first Running/Doc-tests line, and the switch to --message-format=json-render-diagnostics still leaves the rendered errors and the Running lines as text, so CARGO_ERROR and UNIT keep matching.

Not checked: a full red_green.py run against a real PR with two same-named integration targets (there are none in the workspace today), Python 3.12+.

GPUs tested: n/a (Python tests only).
AI-assisted: yes (Claude Code).

Ran natively on Windows 11 (Python 3.11), head `bc00d02dc` merged into current `main` (`fba6f09ce`, clean merge). No findings. This covers the Windows-only part your run skipped. | run | result | |---|---| | `python -I tests/test_red_green.py`, merge | 46 tests, OK, none skipped (the job-object test runs here) | | same, `scripts/red_green.py` from `main`, PR's tests | 1 failure: `test_same_named_cargo_integration_targets_keep_separate_results` | Windows paths (measured). The label comes from `Path(manifest_path).parent.relative_to(tree / "d3d12")`. With `cargo metadata` on this checkout, all 8 integration test targets resolve under the workspace. A drive letter or folder name in a different case still resolves (`C:` vs `c:`, `D3D12` vs `d3d12`). A `\?\` verbatim manifest path doesn't, and falls back to the old `name-hash` label without an error. Cargo doesn't report paths that way here, so that's only a note. Read, not run: the artifact scan stops at the first `Running`/`Doc-tests` line, and the switch to `--message-format=json-render-diagnostics` still leaves the rendered errors and the `Running` lines as text, so `CARGO_ERROR` and `UNIT` keep matching. Not checked: a full `red_green.py` run against a real PR with two same-named integration targets (there are none in the workspace today), Python 3.12+. GPUs tested: n/a (Python tests only). AI-assisted: yes (Claude Code).
Member

Merge check while Forgejo Actions is off: the PR's own tests pass locally on its merge with main 529ba2a219 (head judged: 06e1a175d5), the old code fails the new test (so the test covers the change), check_no_game_data.py clean, and a separate read-only judge (Claude Opus 5.5) accepted it. Main moved only by #3369 (2 unrelated files) before this merge; the server's update merge was checked to give the same tree as the tested change merged on it.

Merge check while Forgejo Actions is off: the PR's own tests pass locally on its merge with main `529ba2a219` (head judged: `06e1a175d5`), the old code fails the new test (so the test covers the change), `check_no_game_data.py` clean, and a separate read-only judge (Claude Opus 5.5) accepted it. Main moved only by #3369 (2 unrelated files) before this merge; the server's update merge was checked to give the same tree as the tested change merged on it.
Sign in to join this conversation.
No description provided.