Keep same-named Cargo integration test results separate #3367

Open
merzleckeier wants to merge 1 commit from upstream-pr/3367 into main
merzleckeier commented 2026-12-03 16:33:34 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-03T16:33:34Z.


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).

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5630660562 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3367). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-12-03T16:33:34Z. --- 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 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Kal0s-design on 2026-12-03T17:03:50Z.


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).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7385900873 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3367#issuecomment-7385900873). Originally posted by [Kal0s-design](https://github.com/Kal0s-design) on 2026-12-03T17:03:50Z. --- 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).
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/3367:upstream-pr/3367'
git switch 'upstream-pr/3367'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/3367'
git switch 'upstream-pr/3367'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3367'
git switch 'upstream-pr/3367'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3367'
git switch 'main'
git merge --squash 'upstream-pr/3367'
git switch 'main'
git merge --ff-only 'upstream-pr/3367'
git switch 'main'
git merge 'upstream-pr/3367'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!3367
No description provided.