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.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #679 +/- ##
==========================================
+ Coverage 79.93% 79.99% +0.05%
==========================================
Files 26 26
Lines 5633 5634 +1
Branches 5633 5634 +1
==========================================
+ Hits 4503 4507 +4
+ Misses 1002 999 -3
Partials 128 128 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
@svasista-ms This will automatically close the issue? Are you sure you want that (as the issue is not fully fixed by this PR)? |
There was a problem hiding this comment.
Its better to rewrite 547 to 560 as single match statement for readability
match wdk_build_number {
n if MISSING_SAMPLE_FLAG_WDK_BUILD_NUMBER_RANGE.contains(&n) => {
warn!("InfVerif skipped for samples class. WDK Build: {wdk_build_number}");
return Ok(());
}
n if n > *MISSING_SAMPLE_FLAG_WDK_BUILD_NUMBER_RANGE.end() => "/samples",
_ => "/msft",
}There was a problem hiding this comment.
Thanks for the suggestion, fixed it ✅ (diff)
| } | ||
|
|
||
| #[test] | ||
| pub fn given_sample_class_and_wdk_build_before_sample_flag_range_then_infverif_runs_with_msft() { |
There was a problem hiding this comment.
| pub fn given_sample_class_and_wdk_build_before_sample_flag_range_then_infverif_runs_with_msft() { | |
| pub fn given_sample_class_is_true_and_wdk_build_below_range_then_inverif_runs_with_msft_flag() { |
| } | ||
|
|
||
| #[test] | ||
| pub fn given_sample_class_and_wdk_build_with_missing_sample_flag_then_infverif_is_skipped() { |
There was a problem hiding this comment.
| pub fn given_sample_class_and_wdk_build_with_missing_sample_flag_then_infverif_is_skipped() { | |
| pub fn given_sample_class_is_true_and_wdk_build_within_range_then_inverif_is_skipped() { |
There was a problem hiding this comment.
Following wording is better with new test scenarios added
pub fn given_sample_class_is_true_and_wdk_build_is_above_range_then_infverif_runs_with_samples_flag_() {There was a problem hiding this comment.
Fixed ✅
Now we have 3 tests:
- Below the Range uses
/msft - In the Range skips
InfVerif - After the Range uses
/samples
…d update related tests
Fix the
InfVerifsample-class gate to skip it only for WDK Versions in the range 25798..=26100 (where the/samplesflag is missing).Partially addresses #170 (for
cargo-wdk).Screenshots
Before:
cargo-wdkskipsInfVeriffor WDK Build# 28000 forsamples:After:
cargo-wdkrunsInfVeriffor WDK Build# 28000 for `samples: