{Storage} Make storage batch tests non-live so CI can catch issues#32143
{Storage} Make storage batch tests non-live so CI can catch issues#32143
Conversation
…nly passes at live test, need to check recording issue
️✔️AzureCLI-FullTest
|
️✔️AzureCLI-BreakingChangeTest
|
|
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>
|
… blob/fileshare path instead. fix some recordings
There was a problem hiding this comment.
Pull Request Overview
This PR converts Azure CLI storage batch operation tests from live tests to recorded tests to enable CI to catch issues more effectively. The changes make the tests non-live by default while preserving functionality through mocked operations.
Reviewed Changes
Copilot reviewed 4 out of 14 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/azure-cli/azure/cli/command_modules/storage/util.py | Fixed path normalization in remote file globbing |
| src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_batch_operations.py | Converted from live to non-live tests, replaced helper methods with explicit container/share creation |
| src/azure-cli/azure/cli/command_modules/storage/operations/file.py | Fixed file path handling and removed unnecessary parameters |
| src/azure-cli/azure/cli/command_modules/storage/operations/blob.py | Enhanced blob copy operations with proper credential handling |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| dir_name, file_name = file_info | ||
| if dryrun: | ||
| logger.warning(' - copy file %s', os.path.join(dir_name, file_name)) | ||
| logger.warning(' - copy file %s', '/'.join(dir_name, file_name)) |
There was a problem hiding this comment.
The string method /'.join() is being called incorrectly. It should be os.path.join(dir_name, file_name) to properly join directory and file names.
| logger.warning(' - copy file %s', '/'.join(dir_name, file_name)) | |
| logger.warning(' - copy file %s', os.path.join(dir_name, file_name)) |
| file_name = os.path.basename(dst2) | ||
|
|
||
| _make_directory_in_files_share(client, destination, dir_name, V2=True) | ||
| _make_directory_in_files_share(client, dir_name) |
There was a problem hiding this comment.
The function signature for _make_directory_in_files_share has been updated to remove the file_share parameter, but this call doesn't match the expected signature. It should be _make_directory_in_files_share(client, dir_name, existing_dirs) to include the optional existing_dirs parameter if available.
Related command
Description
Fix issues with using the same source-account as the destination account as well as issue with
/in path incorrectly changed to\(%5C)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.