refactor: improve cargo-wdk tests#429
Merged
gurry merged 1 commit intomicrosoft:mainfrom Jul 31, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors cargo-wdk tests to improve code maintainability by consolidating duplicate logic and using more descriptive test names. The changes span three test files, replacing verbose test names with concise ones and extracting common functionality into reusable helper functions.
Key changes:
- Simplified test names from verbose descriptions to concise action-based names
- Created helper functions to eliminate code duplication across test scenarios
- Consolidated file verification logic into reusable utility functions
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| crates/cargo-wdk/tests/new_command_test.rs | Shortened test names and extracted command invocation logic into helper functions |
| crates/cargo-wdk/tests/build_command_test.rs | Refactored repetitive file verification code into helper functions and simplified test structure |
| crates/cargo-wdk/src/cli.rs | Consolidated duplicate test logic for architecture detection into parameterized helper functions |
3e70ec1 to
23d97d4
Compare
by reducing code duplication and shortening test names
gurry
commented
Jul 29, 2025
svasista-ms
approved these changes
Jul 30, 2025
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.
This PR improves cargo-wdk tests by:
I wanted to do this for crates/cargo-wdk/src/actions/build/tests.rs as well but those tests are more complex and therefore require more thinking. Will open a different PR for them.