{ACR} Update ACR test suite: remove unnecessary @live_only decorators and make time.sleep conditional on live mode#33135
Conversation
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
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>
|
️✔️AzureCLI-FullTest
|
️✔️AzureCLI-BreakingChangeTest
|
There was a problem hiding this comment.
Pull request overview
This PR primarily refactors the ACR command module test suite to enable more VCR playback coverage and reduce unnecessary delays, alongside updated VCR recordings. It also includes a production-code change in acr/check_health.py affecting CMK validation logic.
Changes:
- Removed or adjusted
@live_only()usage so more ACR scenario tests can run in VCR playback. - Made
time.sleep()calls conditional onself.is_liveto avoid slowing down playback runs; fixed command ordering in a zone-redundancy test. - Updated multiple ACR test recordings to match the new execution paths and CLI/SDK versions.
Reviewed changes
Copilot reviewed 18 out of 42 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/azure-cli/azure/cli/command_modules/acr/tests/latest/test_acr_task_commands.py | Removes live_only usage for task tests; import list changed. |
| src/azure-cli/azure/cli/command_modules/acr/tests/latest/test_acr_connectedregistry_commands.py | Removes live_only usage for a connected registry test; import list changed. |
| src/azure-cli/azure/cli/command_modules/acr/tests/latest/test_acr_commands.py | Keeps live_only where required; gates sleeps on live runs; reorders a replication check. |
| src/azure-cli/azure/cli/command_modules/acr/tests/latest/test_acr_agentpool_commands.py | Cleans up and simplifies imports for agentpool tests. |
| src/azure-cli/azure/cli/command_modules/acr/tests/latest/recordings/*.yaml | Refreshes VCR recordings to align with updated tests and CLI/SDK behavior. |
| src/azure-cli/azure/cli/command_modules/acr/check_health.py | Removes API-version gating around CMK validation (runtime behavior change). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Related command
az acr (various test scenarios)
Description
Test refactoring to the ACR command test suite:
@live_only()decorators fromtest_acr_create_with_managed_registryandtest_acr_connectedregistry_dedicated_endpoint_not_enabledso those tests can run in VCR playback.@live_only()with explanatory comments where confirmed requiredtime.sleep()calls intest_acr_encryption_with_cmkconditional onself.is_liveto avoid unnecessary delays during playback.test_acr_with_zone_redundancy: movedacr replication showon the home region after replications are created, so the check matches current API source.test_acr_agentpool_commands.pyandtest_acr_connectedregistry_commands.py.This 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.