fix(cargo-wdk): update WDK build number range to skip InfVerif when building sample class drivers#679
Conversation
InfVerif when building sample class drivers
There was a problem hiding this comment.
Pull request overview
Updates cargo-wdk’s InfVerif “sample-class” gating logic to only skip InfVerif for a bounded set of WDK build numbers where the required samples flag is missing, and adds/adjusts tests to cover the new behavior (partial progress toward #170).
Changes:
- Narrow InfVerif-skip detection from an open-ended range to
25798..=26100. - Add a dedicated unit test asserting InfVerif is skipped for sample-class drivers within the affected WDK build range.
- Refactor test expectations to allow asserting the packaging flow with and without InfVerif.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
crates/cargo-wdk/src/actions/build/tests.rs |
Adds a new regression test for the WDK-build bounded skip behavior and introduces a helper to assert the packaging path without InfVerif. |
crates/cargo-wdk/src/actions/build/package_task.rs |
Changes the “missing samples flag” build-number range to a bounded inclusive range and updates the associated constant type. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // WDK build 26100 is within the range whose InfVerif is missing the | ||
| // /sample flag, so InfVerif is skipped entirely for the sample class. | ||
| let test_build_action = &TestBuildAction::new(cwd.clone(), profile, None, sample_class) |
| /// Sets up all package-task expectations except `infverif`. Useful for | ||
| /// asserting the sample-class path where `InfVerif` is skipped for WDK | ||
| /// builds whose `InfVerif` is missing the `/sample` flag. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #679 +/- ##
==========================================
+ Coverage 79.93% 80.00% +0.06%
==========================================
Files 26 26
Lines 5633 5635 +2
Branches 5633 5635 +2
==========================================
+ Hits 4503 4508 +5
+ Misses 1002 999 -3
Partials 128 128 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| expected_infverif_args.push("/u".to_string()); | ||
| } | ||
| if self.sample_class { | ||
| expected_infverif_args.push("/msft".to_string()); | ||
| expected_infverif_args.push("/samples".to_string()); | ||
| } |
| .expect_probe_target_arch_using_cargo_rustc(&cwd, target_arch, None) | ||
| .expect_default_package_task_steps(driver_name, driver_type, target_arch, verify_signature) | ||
| .expect_detect_wdk_build_number(25100u32); | ||
| .expect_detect_wdk_build_number(28000u32); |
| if wdk_build_number > *MISSING_SAMPLE_FLAG_WDK_BUILD_NUMBER_RANGE.end() { | ||
| "/samples" | ||
| } else { | ||
| "/msft" | ||
| } |
@svasista-ms This will automatically close the issue? Are you sure you want that (as the issue is not fully fixed by this PR)? |
Fix the InfVerif sample-class gate to skip InfVerif only for WDK builds 25798..=26100 (where the /sample flag is missing).
Partially addresses #170 (for
cargo-wdk).Screenshots
Before:
cargo-wdkskipsInfVeriffor WDK Build# 28000 forsamples:After:
cargo-wdkrunsInfVeriffor WDK Build# 28000 for `samples: