Skip to content

fix(ci): use latest nightly toolchain in the Test workflow, fix assert_matches import and the clippy warning#604

Merged
gurry merged 5 commits intomicrosoft:mainfrom
svasista-ms:fix-clippy-issue
Jan 29, 2026
Merged

fix(ci): use latest nightly toolchain in the Test workflow, fix assert_matches import and the clippy warning#604
gurry merged 5 commits intomicrosoft:mainfrom
svasista-ms:fix-clippy-issue

Conversation

@svasista-ms
Copy link
Contributor

@svasista-ms svasista-ms commented Jan 28, 2026

The Lint workflow is failing with:

  1. error[E0432]: unresolved import std::assert_matches[1]
  2. clippy::map_unwrap_or (pedantic) warning promoted to failure in the job configuration. [2]

I updated my local dev machine to match the toolchain versions used by the pipeline and reproduced the same failure locally.

Also, the issue in macrotest[3] due to which the Test flow's nightly toolchain version was pinned (to nightly-2025-11-20) is now resolved.

In this PR:

  1. Test workflow is updated to use the latest nightly toolchain
  2. The assert_matches import is fixed.
  3. clippy pedantic warning in wdk-build is fixed by replacing env::var(...).map(...).unwrap_or(false) with Result::is_ok_and(...) in is_cargo_make_color_disabled fn.

Copilot AI review requested due to automatic review settings January 28, 2026 08:57
@svasista-ms svasista-ms requested a review from a team January 28, 2026 08:59
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes CI failures by removing the dependency on the nightly-only std::assert_matches macro and addresses a clippy pedantic warning.

Changes:

  • Replaced all assert_matches! macro usages with stable assert!(matches!(...)) alternatives in test code
  • Refactored is_cargo_make_color_disabled() to use Result::is_ok_and() instead of .map().unwrap_or() pattern, fixing a clippy pedantic warning

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
crates/wdk-build/src/lib.rs Removed nightly-only assert_matches import and converted all test assertions to use stable matches! macro within assert! calls
crates/wdk-build/src/cargo_make.rs Refactored environment variable checking to use is_ok_and() for cleaner, more idiomatic code

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov-commenter
Copy link

codecov-commenter commented Jan 28, 2026

Codecov Report

❌ Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.23%. Comparing base (8046305) to head (943b0f6).

Files with missing lines Patch % Lines
crates/wdk-build/src/cargo_make.rs 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #604      +/-   ##
==========================================
+ Coverage   76.52%   77.23%   +0.71%     
==========================================
  Files          24       24              
  Lines        4881     4783      -98     
  Branches     4881     4783      -98     
==========================================
- Hits         3735     3694      -41     
+ Misses       1029      972      -57     
  Partials      117      117              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@svasista-ms svasista-ms changed the title fix: nightly-only assert_matches usage and clippy pedantic warning fix(ci): use latest nightly toolchain in the Test workflow, fix assert_matches import and the clippy warning Jan 29, 2026
@gurry gurry added this pull request to the merge queue Jan 29, 2026
Merged via the queue into microsoft:main with commit e19c3a1 Jan 29, 2026
324 of 326 checks passed
@gurry gurry deleted the fix-clippy-issue branch January 29, 2026 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants