Skip to content

Commit 3023952

Browse files
[Storage] Fix failing pipeline tests (test_share.py) + name_starts_with async bug fix (Azure#26793)
* Add playback only tag to failing live tests * Refactored to hopefully get rid of conflicts * Tests should pass now, fix prefix bug * Re-record test to fix CI
1 parent 80970bf commit 3023952

13 files changed

+377
-2016
lines changed

sdk/storage/azure-storage-file-share/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
### Breaking Changes
88

99
### Bugs Fixed
10+
- Fixed an issue where keyword `name_starts_with` was not being passed to the service properly for the `list_shares` async API
1011

1112
### Other Changes
1213
- Removed `msrest` dependency.

sdk/storage/azure-storage-file-share/azure/storage/fileshare/aio/_models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ async def _get_next_cb(self, continuation_token):
5959
return await self._command(
6060
marker=continuation_token or None,
6161
maxresults=self.results_per_page,
62+
prefix=self.prefix,
6263
cls=return_context_and_deserialized,
6364
use_location=self.location_mode)
6465
except HttpResponseError as error:

sdk/storage/azure-storage-file-share/azure/storage/fileshare/aio/_share_service_client_async.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,13 +214,13 @@ def list_shares(
214214
"""
215215
timeout = kwargs.pop('timeout', None)
216216
include = []
217+
include_deleted = kwargs.pop('include_deleted', None)
218+
if include_deleted:
219+
include.append("deleted")
217220
if include_metadata:
218221
include.append('metadata')
219222
if include_snapshots:
220223
include.append('snapshots')
221-
include_deleted = kwargs.pop('include_deleted', None)
222-
if include_deleted:
223-
include.append("deleted")
224224

225225
results_per_page = kwargs.pop('results_per_page', None)
226226
command = functools.partial(

sdk/storage/azure-storage-file-share/tests/recordings/test_share.pyTestStorageSharetest_list_shares_with_include_metadata.json

Lines changed: 18 additions & 272 deletions
Large diffs are not rendered by default.

sdk/storage/azure-storage-file-share/tests/recordings/test_share.pyTestStorageSharetest_list_shares_with_num_results_and_marker.json

Lines changed: 53 additions & 280 deletions
Large diffs are not rendered by default.

sdk/storage/azure-storage-file-share/tests/recordings/test_share.pyTestStorageSharetest_list_shares_with_prefix.json

Lines changed: 74 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
{
22
"Entries": [
33
{
4-
"RequestUri": "https://storagename.file.core.windows.net/share6b262aeb?restype=share",
4+
"RequestUri": "https://storagename.file.core.windows.net/othershare6b262aeb?restype=share",
55
"RequestMethod": "PUT",
66
"RequestHeaders": {
77
"Accept": "application/xml",
88
"Accept-Encoding": "gzip, deflate",
99
"Connection": "keep-alive",
1010
"Content-Length": "0",
11-
"User-Agent": "azsdk-python-storage-file-share/12.10.0 Python/3.10.2 (Windows-10-10.0.19044-SP0)",
12-
"x-ms-date": "Sat, 08 Oct 2022 00:01:42 GMT",
11+
"User-Agent": "azsdk-python-storage-file-share/12.10.1 Python/3.10.2 (Windows-10-10.0.19044-SP0)",
12+
"x-ms-date": "Fri, 14 Oct 2022 22:29:36 GMT",
1313
"x-ms-version": "2021-06-08"
1414
},
1515
"RequestBody": null,
1616
"StatusCode": 201,
1717
"ResponseHeaders": {
1818
"Content-Length": "0",
19-
"Date": "Sat, 08 Oct 2022 00:01:43 GMT",
20-
"ETag": "\u00220x8DAA8C04933339E\u0022",
21-
"Last-Modified": "Sat, 08 Oct 2022 00:01:44 GMT",
19+
"Date": "Fri, 14 Oct 2022 22:29:36 GMT",
20+
"ETag": "\u00220x8DAAE339344996C\u0022",
21+
"Last-Modified": "Fri, 14 Oct 2022 22:29:36 GMT",
2222
"Server": [
2323
"Windows-Azure-File/1.0",
2424
"Microsoft-HTTPAPI/2.0"
@@ -28,29 +28,57 @@
2828
"ResponseBody": null
2929
},
3030
{
31-
"RequestUri": "https://storagename.file.core.windows.net/?comp=list\u0026prefix=share6b262aeb\u0026include=",
31+
"RequestUri": "https://storagename.file.core.windows.net/random26b262aeb?restype=share",
32+
"RequestMethod": "PUT",
33+
"RequestHeaders": {
34+
"Accept": "application/xml",
35+
"Accept-Encoding": "gzip, deflate",
36+
"Connection": "keep-alive",
37+
"Content-Length": "0",
38+
"User-Agent": "azsdk-python-storage-file-share/12.10.1 Python/3.10.2 (Windows-10-10.0.19044-SP0)",
39+
"x-ms-date": "Fri, 14 Oct 2022 22:29:37 GMT",
40+
"x-ms-version": "2021-06-08"
41+
},
42+
"RequestBody": null,
43+
"StatusCode": 201,
44+
"ResponseHeaders": {
45+
"Content-Length": "0",
46+
"Date": "Fri, 14 Oct 2022 22:29:36 GMT",
47+
"ETag": "\u00220x8DAAE339357F78B\u0022",
48+
"Last-Modified": "Fri, 14 Oct 2022 22:29:36 GMT",
49+
"Server": [
50+
"Windows-Azure-File/1.0",
51+
"Microsoft-HTTPAPI/2.0"
52+
],
53+
"x-ms-version": "2021-06-08"
54+
},
55+
"ResponseBody": null
56+
},
57+
{
58+
"RequestUri": "https://storagename.file.core.windows.net/?comp=list\u0026prefix=random26b262aeb\u0026include=",
3259
"RequestMethod": "GET",
3360
"RequestHeaders": {
3461
"Accept": "application/xml",
3562
"Accept-Encoding": "gzip, deflate",
3663
"Connection": "keep-alive",
37-
"User-Agent": "azsdk-python-storage-file-share/12.10.0 Python/3.10.2 (Windows-10-10.0.19044-SP0)",
38-
"x-ms-date": "Sat, 08 Oct 2022 00:01:43 GMT",
64+
"User-Agent": "azsdk-python-storage-file-share/12.10.1 Python/3.10.2 (Windows-10-10.0.19044-SP0)",
65+
"x-ms-date": "Fri, 14 Oct 2022 22:29:37 GMT",
3966
"x-ms-version": "2021-06-08"
4067
},
4168
"RequestBody": null,
4269
"StatusCode": 200,
4370
"ResponseHeaders": {
4471
"Content-Type": "application/xml",
45-
"Date": "Sat, 08 Oct 2022 00:01:43 GMT",
72+
"Date": "Fri, 14 Oct 2022 22:29:36 GMT",
4673
"Server": [
4774
"Windows-Azure-File/1.0",
4875
"Microsoft-HTTPAPI/2.0"
4976
],
5077
"Transfer-Encoding": "chunked",
78+
"Vary": "Origin",
5179
"x-ms-version": "2021-06-08"
5280
},
53-
"ResponseBody": "\uFEFF\u003C?xml version=\u00221.0\u0022 encoding=\u0022utf-8\u0022?\u003E\u003CEnumerationResults ServiceEndpoint=\u0022https://storagename.file.core.windows.net/\u0022\u003E\u003CPrefix\u003Eshare6b262aeb\u003C/Prefix\u003E\u003CShares\u003E\u003CShare\u003E\u003CName\u003Eshare6b262aeb\u003C/Name\u003E\u003CProperties\u003E\u003CLast-Modified\u003ESat, 08 Oct 2022 00:01:44 GMT\u003C/Last-Modified\u003E\u003CEtag\u003E\u00220x8DAA8C04933339E\u0022\u003C/Etag\u003E\u003CLeaseStatus\u003Eunlocked\u003C/LeaseStatus\u003E\u003CLeaseState\u003Eavailable\u003C/LeaseState\u003E\u003CQuota\u003E5120\u003C/Quota\u003E\u003CAccessTier\u003ETransactionOptimized\u003C/AccessTier\u003E\u003CAccessTierChangeTime\u003ESat, 08 Oct 2022 00:01:44 GMT\u003C/AccessTierChangeTime\u003E\u003CDefaultEncryptionScope\u003E$account-encryption-key\u003C/DefaultEncryptionScope\u003E\u003CDenyEncryptionScopeOverride\u003Efalse\u003C/DenyEncryptionScopeOverride\u003E\u003C/Properties\u003E\u003C/Share\u003E\u003C/Shares\u003E\u003CNextMarker /\u003E\u003C/EnumerationResults\u003E"
81+
"ResponseBody": "\uFEFF\u003C?xml version=\u00221.0\u0022 encoding=\u0022utf-8\u0022?\u003E\u003CEnumerationResults ServiceEndpoint=\u0022https://storagename.file.core.windows.net/\u0022\u003E\u003CPrefix\u003Erandom26b262aeb\u003C/Prefix\u003E\u003CShares\u003E\u003CShare\u003E\u003CName\u003Erandom26b262aeb\u003C/Name\u003E\u003CProperties\u003E\u003CLast-Modified\u003EFri, 14 Oct 2022 22:29:36 GMT\u003C/Last-Modified\u003E\u003CEtag\u003E\u00220x8DAAE339357F78B\u0022\u003C/Etag\u003E\u003CLeaseStatus\u003Eunlocked\u003C/LeaseStatus\u003E\u003CLeaseState\u003Eavailable\u003C/LeaseState\u003E\u003CQuota\u003E5120\u003C/Quota\u003E\u003CAccessTier\u003ETransactionOptimized\u003C/AccessTier\u003E\u003CAccessTierChangeTime\u003EFri, 14 Oct 2022 22:29:36 GMT\u003C/AccessTierChangeTime\u003E\u003CDefaultEncryptionScope\u003E$account-encryption-key\u003C/DefaultEncryptionScope\u003E\u003CDenyEncryptionScopeOverride\u003Efalse\u003C/DenyEncryptionScopeOverride\u003E\u003C/Properties\u003E\u003C/Share\u003E\u003C/Shares\u003E\u003CNextMarker /\u003E\u003C/EnumerationResults\u003E"
5482
},
5583
{
5684
"RequestUri": "https://storagename.file.core.windows.net/?comp=list\u0026include=snapshots",
@@ -59,42 +87,69 @@
5987
"Accept": "application/xml",
6088
"Accept-Encoding": "gzip, deflate",
6189
"Connection": "keep-alive",
62-
"User-Agent": "azsdk-python-storage-file-share/12.10.0 Python/3.10.2 (Windows-10-10.0.19044-SP0)",
63-
"x-ms-date": "Sat, 08 Oct 2022 00:01:43 GMT",
90+
"User-Agent": "azsdk-python-storage-file-share/12.10.1 Python/3.10.2 (Windows-10-10.0.19044-SP0)",
91+
"x-ms-date": "Fri, 14 Oct 2022 22:29:37 GMT",
6492
"x-ms-version": "2021-06-08"
6593
},
6694
"RequestBody": null,
6795
"StatusCode": 200,
6896
"ResponseHeaders": {
6997
"Content-Type": "application/xml",
70-
"Date": "Sat, 08 Oct 2022 00:01:43 GMT",
98+
"Date": "Fri, 14 Oct 2022 22:29:36 GMT",
7199
"Server": [
72100
"Windows-Azure-File/1.0",
73101
"Microsoft-HTTPAPI/2.0"
74102
],
75103
"Transfer-Encoding": "chunked",
104+
"Vary": "Origin",
76105
"x-ms-version": "2021-06-08"
77106
},
78-
"ResponseBody": "\uFEFF\u003C?xml version=\u00221.0\u0022 encoding=\u0022utf-8\u0022?\u003E\u003CEnumerationResults ServiceEndpoint=\u0022https://storagename.file.core.windows.net/\u0022\u003E\u003CShares\u003E\u003CShare\u003E\u003CName\u003Eshare6b262aeb\u003C/Name\u003E\u003CProperties\u003E\u003CLast-Modified\u003ESat, 08 Oct 2022 00:01:44 GMT\u003C/Last-Modified\u003E\u003CEtag\u003E\u00220x8DAA8C04933339E\u0022\u003C/Etag\u003E\u003CLeaseStatus\u003Eunlocked\u003C/LeaseStatus\u003E\u003CLeaseState\u003Eavailable\u003C/LeaseState\u003E\u003CQuota\u003E5120\u003C/Quota\u003E\u003CAccessTier\u003ETransactionOptimized\u003C/AccessTier\u003E\u003CAccessTierChangeTime\u003ESat, 08 Oct 2022 00:01:44 GMT\u003C/AccessTierChangeTime\u003E\u003CDefaultEncryptionScope\u003E$account-encryption-key\u003C/DefaultEncryptionScope\u003E\u003CDenyEncryptionScopeOverride\u003Efalse\u003C/DenyEncryptionScopeOverride\u003E\u003C/Properties\u003E\u003C/Share\u003E\u003C/Shares\u003E\u003CNextMarker /\u003E\u003C/EnumerationResults\u003E"
107+
"ResponseBody": "\uFEFF\u003C?xml version=\u00221.0\u0022 encoding=\u0022utf-8\u0022?\u003E\u003CEnumerationResults ServiceEndpoint=\u0022https://storagename.file.core.windows.net/\u0022\u003E\u003CShares\u003E\u003CShare\u003E\u003CName\u003Eothershare6b262aeb\u003C/Name\u003E\u003CProperties\u003E\u003CLast-Modified\u003EFri, 14 Oct 2022 22:29:36 GMT\u003C/Last-Modified\u003E\u003CEtag\u003E\u00220x8DAAE339344996C\u0022\u003C/Etag\u003E\u003CLeaseStatus\u003Eunlocked\u003C/LeaseStatus\u003E\u003CLeaseState\u003Eavailable\u003C/LeaseState\u003E\u003CQuota\u003E5120\u003C/Quota\u003E\u003CAccessTier\u003ETransactionOptimized\u003C/AccessTier\u003E\u003CAccessTierChangeTime\u003EFri, 14 Oct 2022 22:29:36 GMT\u003C/AccessTierChangeTime\u003E\u003CDefaultEncryptionScope\u003E$account-encryption-key\u003C/DefaultEncryptionScope\u003E\u003CDenyEncryptionScopeOverride\u003Efalse\u003C/DenyEncryptionScopeOverride\u003E\u003C/Properties\u003E\u003C/Share\u003E\u003CShare\u003E\u003CName\u003Erandom26b262aeb\u003C/Name\u003E\u003CProperties\u003E\u003CLast-Modified\u003EFri, 14 Oct 2022 22:29:36 GMT\u003C/Last-Modified\u003E\u003CEtag\u003E\u00220x8DAAE339357F78B\u0022\u003C/Etag\u003E\u003CLeaseStatus\u003Eunlocked\u003C/LeaseStatus\u003E\u003CLeaseState\u003Eavailable\u003C/LeaseState\u003E\u003CQuota\u003E5120\u003C/Quota\u003E\u003CAccessTier\u003ETransactionOptimized\u003C/AccessTier\u003E\u003CAccessTierChangeTime\u003EFri, 14 Oct 2022 22:29:36 GMT\u003C/AccessTierChangeTime\u003E\u003CDefaultEncryptionScope\u003E$account-encryption-key\u003C/DefaultEncryptionScope\u003E\u003CDenyEncryptionScopeOverride\u003Efalse\u003C/DenyEncryptionScopeOverride\u003E\u003C/Properties\u003E\u003C/Share\u003E\u003C/Shares\u003E\u003CNextMarker /\u003E\u003C/EnumerationResults\u003E"
108+
},
109+
{
110+
"RequestUri": "https://storagename.file.core.windows.net/othershare6b262aeb?restype=share",
111+
"RequestMethod": "DELETE",
112+
"RequestHeaders": {
113+
"Accept": "application/xml",
114+
"Accept-Encoding": "gzip, deflate",
115+
"Connection": "keep-alive",
116+
"Content-Length": "0",
117+
"User-Agent": "azsdk-python-storage-file-share/12.10.1 Python/3.10.2 (Windows-10-10.0.19044-SP0)",
118+
"x-ms-date": "Fri, 14 Oct 2022 22:29:37 GMT",
119+
"x-ms-delete-snapshots": "include",
120+
"x-ms-version": "2021-06-08"
121+
},
122+
"RequestBody": null,
123+
"StatusCode": 202,
124+
"ResponseHeaders": {
125+
"Content-Length": "0",
126+
"Date": "Fri, 14 Oct 2022 22:29:36 GMT",
127+
"Server": [
128+
"Windows-Azure-File/1.0",
129+
"Microsoft-HTTPAPI/2.0"
130+
],
131+
"x-ms-version": "2021-06-08"
132+
},
133+
"ResponseBody": null
79134
},
80135
{
81-
"RequestUri": "https://storagename.file.core.windows.net/share6b262aeb?restype=share",
136+
"RequestUri": "https://storagename.file.core.windows.net/random26b262aeb?restype=share",
82137
"RequestMethod": "DELETE",
83138
"RequestHeaders": {
84139
"Accept": "application/xml",
85140
"Accept-Encoding": "gzip, deflate",
86141
"Connection": "keep-alive",
87142
"Content-Length": "0",
88-
"User-Agent": "azsdk-python-storage-file-share/12.10.0 Python/3.10.2 (Windows-10-10.0.19044-SP0)",
89-
"x-ms-date": "Sat, 08 Oct 2022 00:01:43 GMT",
143+
"User-Agent": "azsdk-python-storage-file-share/12.10.1 Python/3.10.2 (Windows-10-10.0.19044-SP0)",
144+
"x-ms-date": "Fri, 14 Oct 2022 22:29:37 GMT",
90145
"x-ms-delete-snapshots": "include",
91146
"x-ms-version": "2021-06-08"
92147
},
93148
"RequestBody": null,
94149
"StatusCode": 202,
95150
"ResponseHeaders": {
96151
"Content-Length": "0",
97-
"Date": "Sat, 08 Oct 2022 00:01:43 GMT",
152+
"Date": "Fri, 14 Oct 2022 22:29:36 GMT",
98153
"Server": [
99154
"Windows-Azure-File/1.0",
100155
"Microsoft-HTTPAPI/2.0"

0 commit comments

Comments
 (0)