Skip to content

Commit c3ed213

Browse files
Suyash ChoudharyCopilot
andcommitted
test(storagemover): pin cross-sub mgmt client api_versions
Build 6327280 reproduced a new failure mode on the whl + sdist CI legs (mindependency now passes after the previous skip-marker landed): Playback failure -- Uri doesn't match: request <...?api-version=2025-08-01> record <...?api-version=2025-06-01> Root cause: my local recording environment had azure-mgmt-storage 24.0.1 (default api-version 2025-06-01); CI's whl/sdist venvs pull the latest released azure-mgmt-storage 25.0.0 (default 2025-08-01). URL mismatch -> cassette miss -> proxy returns 404. Pin api_version explicitly on the cross-sub clients to the versions captured in the recordings: - StorageManagementClient -> '2025-06-01' - NetworkManagementClient -> '2025-05-01' - AuthorizationManagementClient already pinned via the v2022_04_01 namespace import (no kwarg needed) Applied to all 4 affected test methods (sync + async * #10 + #31). The recordings themselves are unchanged. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 4481651 commit c3ed213

2 files changed

Lines changed: 16 additions & 3 deletions

File tree

sdk/storagemover/azure-mgmt-storagemover/tests/test_storage_mover_mgmt_job_definitions_operations_async_test.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,13 @@ async def test_job_definition_job_run(self, resource_group, **kwargs):
139139

140140
# Async cross-sub clients (test-proxy's async-transport interception
141141
# covers them; sync clients here would bypass the proxy and hit live).
142+
# Pin api_version explicitly so playback stays stable as the underlying
143+
# mgmt packages bump default api-versions in future releases.
142144
storage_client = self.create_client_from_credential(
143145
StorageManagementClient,
144146
self.get_credential(StorageManagementClient, is_async=True),
145147
subscription_id=SYNTHETICS_SUBSCRIPTION_ID,
148+
api_version="2025-06-01",
146149
)
147150
authorization_client = self.create_client_from_credential(
148151
AuthorizationManagementClient,
@@ -483,15 +486,18 @@ async def test_start_c2c_job_with_private_source(self, resource_group, **kwargs)
483486

484487
# Async cross-sub clients (test-proxy's async-transport interception
485488
# covers them; sync clients here would bypass the proxy and hit live).
489+
# Pin api_version explicitly — see #10 above.
486490
network_client = self.create_client_from_credential(
487491
NetworkManagementClient,
488492
self.get_credential(NetworkManagementClient, is_async=True),
489493
subscription_id=SYNTHETICS_SUBSCRIPTION_ID,
494+
api_version="2025-05-01",
490495
)
491496
storage_client = self.create_client_from_credential(
492497
StorageManagementClient,
493498
self.get_credential(StorageManagementClient, is_async=True),
494499
subscription_id=SYNTHETICS_SUBSCRIPTION_ID,
500+
api_version="2025-06-01",
495501
)
496502
authorization_client = self.create_client_from_credential(
497503
AuthorizationManagementClient,

sdk/storagemover/azure-mgmt-storagemover/tests/test_storage_mover_mgmt_job_definitions_operations_test.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ def test_job_definition_job_run(self, resource_group, **kwargs):
172172
storage_client = self.create_client_from_credential(
173173
StorageManagementClient, self.get_credential(StorageManagementClient),
174174
subscription_id=SYNTHETICS_SUBSCRIPTION_ID,
175+
api_version="2025-06-01",
175176
)
176177
authorization_client = self.create_client_from_credential(
177178
AuthorizationManagementClient, self.get_credential(AuthorizationManagementClient),
@@ -538,16 +539,22 @@ def test_start_c2c_job_with_private_source(self, resource_group, **kwargs):
538539
role_assignment_name = variables.setdefault("role_assignment_id", str(uuid.uuid4()))
539540

540541
# Cross-sub mgmt clients (override subscription_id at construction).
542+
# Cross-sub mgmt clients. Pin api_version explicitly — see #10 above.
541543
network_client = self.create_client_from_credential(
542-
NetworkManagementClient, self.get_credential(NetworkManagementClient),
544+
NetworkManagementClient,
545+
self.get_credential(NetworkManagementClient),
543546
subscription_id=SYNTHETICS_SUBSCRIPTION_ID,
547+
api_version="2025-05-01",
544548
)
545549
storage_client = self.create_client_from_credential(
546-
StorageManagementClient, self.get_credential(StorageManagementClient),
550+
StorageManagementClient,
551+
self.get_credential(StorageManagementClient),
547552
subscription_id=SYNTHETICS_SUBSCRIPTION_ID,
553+
api_version="2025-06-01",
548554
)
549555
authorization_client = self.create_client_from_credential(
550-
AuthorizationManagementClient, self.get_credential(AuthorizationManagementClient),
556+
AuthorizationManagementClient,
557+
self.get_credential(AuthorizationManagementClient),
551558
subscription_id=SYNTHETICS_SUBSCRIPTION_ID,
552559
)
553560

0 commit comments

Comments
 (0)