-
Notifications
You must be signed in to change notification settings - Fork 0
add some test code #9
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
base: dev
Are you sure you want to change the base?
Conversation
|
The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR. Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
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 adds test code to the Azure CLI VM module, introducing debugging variables in the VM creation function and a test class for PR review purposes.
- Added hardcoded test variables in the
create_vmfunction - Added a test class
test_PR_reviewwith a simple test method - Made minor documentation updates to existing parameter help text
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| src/azure-cli/azure/cli/command_modules/vm/custom.py | Added test variables in create_vm function and test class at end of file |
| src/azure-cli/azure/cli/command_modules/vm/_params.py | Added duplicate parameter definitions and minor help text changes |
| i = 8808 | ||
| j = 8809 | ||
| test_port = 8810 | ||
| testPort2 = 8811 | ||
| testPort3 = (12*23+14) | ||
| test_str= 'test' |
Copilot
AI
Sep 9, 2025
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.
These test variables should be removed from production code. Test code should not be added to the main VM creation function. Use proper test files instead.
| test_port = 8810 | ||
| testPort2 = 8811 | ||
| testPort3 = (12*23+14) | ||
| test_str= 'test' |
Copilot
AI
Sep 9, 2025
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.
Inconsistent spacing around assignment operator. Should be 'test_str = 'test'' with single spaces around the equals sign.
|
|
||
|
|
||
| class test_PR_review: | ||
| def testPPReviw(self): |
Copilot
AI
Sep 9, 2025
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.
Method name contains a typo: 'testPPReviw' should be 'testPRReview' or similar.
| c.argument('enable_bursting1', arg_type=get_three_state_flag(), help='Enables on-demand bursting beyond the provisioned performance target of the disk. On-demand bursting is disabled by default, and it does not apply to Ultra disks.') | ||
| c.argument('enable_bursting2', arg_type=get_three_state_flag(), help='Enabled on-demand bursting beyond the provisioned performance target of the disk. On-demand bursting is disabled by default, and it does not apply to Ultra disks.') |
Copilot
AI
Sep 9, 2025
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.
These appear to be duplicate parameter definitions of the existing 'enable_bursting' parameter. Duplicate parameters will cause conflicts and should be removed.
| c.argument('disk_access', min_api='2020-05-01', help='Name or ID of the disk access resource for using private endpoints on disks.') | ||
| c.argument('enable_bursting', arg_type=get_three_state_flag(), help='Enable on-demand bursting beyond the provisioned performance target of the disk. On-demand bursting is disabled by default, and it does not apply to Ultra disks.') | ||
| c.argument('enable_bursting1', arg_type=get_three_state_flag(), help='Enables on-demand bursting beyond the provisioned performance target of the disk. On-demand bursting is disabled by default, and it does not apply to Ultra disks.') | ||
| c.argument('enable_bursting2', arg_type=get_three_state_flag(), help='Enabled on-demand bursting beyond the provisioned performance target of the disk. On-demand bursting is disabled by default, and it does not apply to Ultra disks.') |
Copilot
AI
Sep 9, 2025
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.
Help text has grammatical error: 'Enabled on-demand bursting' should be 'Enable on-demand bursting' to match the verb form used in the original parameter.
|
This pull request introduces several minor changes to the VM command module, mostly focused on argument definitions and some test-related additions. The most notable updates are the addition of new disk bursting flags, minor improvements to help text for argument clarity, and the introduction of a test class. Argument additions and modifications:
Test and code organization:
Other minor changes include removing a blank line for code tidiness. |
Related command
Description
Testing Guide
History Notes
[Component Name 1] BREAKING CHANGE:
az command a: Make some customer-facing breaking change[Component Name 2]
az command b: Add some customer-facing featureThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.