feat(ci): add file attribute to junit.xml from cargo-nextest [APMSP-3364]#239
Open
bantonsson wants to merge 2 commits into
Open
feat(ci): add file attribute to junit.xml from cargo-nextest [APMSP-3364]#239bantonsson wants to merge 2 commits into
bantonsson wants to merge 2 commits into
Conversation
🎉 All green!🧪 All tests passed 🔗 Commit SHA: 9c36d1f | Docs | Datadog PR Page | Give us feedback! |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a557407c83
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
74a19b4 to
825c4a0
Compare
ekump
approved these changes
May 28, 2026
…MSP-3376] Add scripts/pack-system-tests-artifact.sh to replace the hardcoded `cp -r datadog-opentelemetry Cargo.toml` in the build-artifacts CI job. The old approach broke when a new crate was added at the workspace root: Cargo.toml listed it as a member but its source was absent from the artifact, causing the system-test Docker build to fail. The script reads [workspace] members from Cargo.toml, deduplicates nested paths, and copies the unique root directories. New workspace crates are included automatically.
Add a tools crate with an add_junit_file_attributes binary that enriches JUnit XML output from cargo-nextest with the 'file' attribute on each <testcase> element. Test Optimization requires this attribute to resolve test owners via CODEOWNERS. The binary uses cargo metadata to map (package, target) pairs to source file paths. Unit tests use module-path heuristics (src/<module>.rs / src/<module>/mod.rs) to narrow down to the specific file; integration tests and binaries resolve directly from their target src_path. This is the same fix applied to libdatadog in APMSP-2547. The new step runs after cargo nextest (on success or failure) and before JUnit report upload, so both the GitHub check report and the Datadog CI upload receive enriched XML.
6ee1993 to
9c36d1f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Add a tools crate with an add_junit_file_attributes binary that enriches JUnit XML output from cargo-nextest with the 'file' attribute on each element. Test Optimization requires this attribute to resolve test owners via CODEOWNERS.
The binary uses cargo metadata to map (package, target) pairs to source file paths. Unit tests use module-path heuristics (src/.rs / src//mod.rs) to narrow down to the specific file; integration tests and binaries resolve directly from their target src_path.
This is the same fix applied to libdatadog in DataDog/libdatadog#1487.
The new step runs after cargo nextest (on success or failure) and before JUnit report upload, so both the GitHub check report and the Datadog CI upload receive enriched XML.
Motivation
Green CI metrics showing a lot of unowned tests.
Additional Notes