Keep same-named Cargo integration test results separate #3367

Open
github-bot wants to merge 1 commit from github-bot/gh-3367 into main AGit
Owner

@⁠merzleckeier on GitHub · 2026-12-03 16:33 UTC · original
merzleckeier:fix/red-green-cargo-integration-target-identity → main · +62 −5 · 3 files · 1 commits · open

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

**@⁠merzleckeier** on GitHub · 2026-12-03 16:33 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/3367) `merzleckeier:fix/red-green-cargo-integration-target-identity` → `main` · +62 −5 · 3 files · 1 commits · open Claimed in [#3312](https://git.gtahub.st/github/ubiquitarianism--leonida/issues/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).
Use Cargo's pre-test compiler artifacts to identify integration targets by workspace-relative package and target name. Keep the existing unit and doctest labels. AI-assisted with OpenAI Codex and independently reviewed by GPT-6.2 Sol.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-03 16:53:16 +00:00
Author
Owner

@⁠Kal0s-design on GitHub · 2026-12-03 17:03 UTC · original

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

**@⁠Kal0s-design** on GitHub · 2026-12-03 17:03 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/3367#issuecomment-7385900873) 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 can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/3367/head:github-bot/gh-3367'
git switch 'github-bot/gh-3367'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-3367'
git switch 'github-bot/gh-3367'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-3367'
git switch 'github-bot/gh-3367'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-3367'
git switch 'main'
git merge --squash 'github-bot/gh-3367'
git switch 'main'
git merge --ff-only 'github-bot/gh-3367'
git switch 'main'
git merge 'github-bot/gh-3367'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/ubiquitarianism--leonida!3367
No description provided.