RustPackageHelper.py: Update __set_members to avoid duplicates - #1915
Conversation
✅ QEMU Validation PassedSource Dependencies
Results
Workflow run: https://github.com/microsoft/mu_basecore/actions/runs/35126023232 This comment was automatically generated by the Mu QEMU PR Validation workflow. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## release/202511 #1915 +/- ##
=================================================
Coverage ? 2.23%
=================================================
Files ? 1670
Lines ? 427108
Branches ? 5079
=================================================
Hits ? 9529
Misses ? 417495
Partials ? 84
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Michael Kubacki (makubacki)
left a comment
There was a problem hiding this comment.
This would benefit from unit tests, but I don't think it's necessary given there are currently none in the plugin.
e0287b9 to
7ae6858
Compare
It was simple enough to add unit tests for __set_members. I modeled it after the DebugMacroCheckPlugin test design. |
Deduplicate crates listed as both workspace members and path dependencies. Add tests covering duplicate paths, dependency filtering, and empty workspaces.
Head branch was pushed to by a user without write access
7ae6858 to
8fcbf07
Compare
Description
RustPackageHelperto deduplicate Cargo workspace members by path before constructingRustPackageobjects.__set_membersfunction.type(...) != strcomparison withisinstance()when identifying path-based workspace dependencies.Some local crates are declared both as Cargo workspace members and as path-based workspace dependencies. The previous implementation placed
RustPackageinstances in a set, butRustPackagedoes not define value-based equality or hashing. Separate instances representing the same path were therefore retained as distinct entries.Collecting
Pathobjects in the set provides value-based deduplication and ensures each workspace package is tested once.How This Was Tested
Ran the Rust host-based unit test runner through
stuart_ci_build.Verified that each crate appears only once in the generated Cargo coverage command.
All unit tests are passing.
Integration Instructions
N/A