-
Notifications
You must be signed in to change notification settings - Fork 104
refactor: improve cargo-wdk tests #429
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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 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
krishnakumar4a4
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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.