add some test code#9
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.
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' |
There was a problem hiding this comment.
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' |
There was a problem hiding this comment.
Inconsistent spacing around assignment operator. Should be 'test_str = 'test'' with single spaces around the equals sign.
|
|
||
|
|
||
| class test_PR_review: | ||
| def testPPReviw(self): |
There was a problem hiding this comment.
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.') |
There was a problem hiding this comment.
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.') |
There was a problem hiding this comment.
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.