-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Storage][Test] Test multiple service versions (#19039)
* adding infra for specifying service version from env var or by default * changes for blob to show usage * updates for storage-queue * adding bens comment and assert policy for blob * removing * key change * fixing way service version is read * fixing an issue * adding skipif the sv is too low
- Loading branch information
1 parent
0c573e6
commit e7cf320
Showing
8 changed files
with
182 additions
and
7 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
sdk/storage/azure-storage-blob/tests/_shared/service_versions.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
from datetime import datetime | ||
from enum import Enum | ||
import os | ||
|
||
|
||
class ServiceVersion(str, Enum): | ||
|
||
V2019_02_02 = "2019-02-02" | ||
V2019_07_07 = "2019-07-07" | ||
V2019_10_10 = "2019-10-10" | ||
V2019_12_12 = "2019-12-12" | ||
V2020_02_10 = "2020-02-10" | ||
V2020_04_08 = "2020-04-08" | ||
V2020_06_12 = "2020-06-12" | ||
V2020_08_04 = "2020-08-04" | ||
|
||
|
||
service_version_map = { | ||
"V2019_02_02": ServiceVersion.V2019_02_02, | ||
"V2019_07_07": ServiceVersion.V2019_07_07, | ||
"V2019_10_10": ServiceVersion.V2019_10_10, | ||
"V2019_12_12": ServiceVersion.V2019_12_12, | ||
"V2020_02_10": ServiceVersion.V2020_02_10, | ||
"V2020_04_08": ServiceVersion.V2020_04_08, | ||
"V2020_06_12": ServiceVersion.V2020_06_12, | ||
"V2020_08_04": ServiceVersion.V2020_08_04, | ||
"LATEST": ServiceVersion.V2020_08_04, | ||
"LATEST_PLUS_1": ServiceVersion.V2020_06_12 | ||
} | ||
|
||
|
||
def is_version_before(test_version): | ||
""" Return True if the current version is after a given one or if the | ||
service version is not set. | ||
""" | ||
current_version = service_version_map.get(os.environ.get("AZURE_LIVE_TEST_SERVICE_VERSION")) | ||
if not current_version: | ||
return True | ||
current_version_data = datetime.strptime(current_version, "%Y-%m-%d") | ||
test_version_minimum = datetime.strptime(test_version, "%Y-%m-%d") | ||
ret = current_version_data < test_version_minimum | ||
return ret |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
sdk/storage/azure-storage-queue/tests/_shared/service_versions.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from enum import Enum | ||
|
||
|
||
class ServiceVersion(str, Enum): | ||
|
||
V2019_02_02 = "2019-02-02" | ||
V2019_07_07 = "2019-07-07" | ||
V2019_10_10 = "2019-10-10" | ||
V2019_12_12 = "2019-12-12" | ||
V2020_02_10 = "2020-02-10" | ||
V2020_04_08 = "2020-04-08" | ||
V2020_06_12 = "2020-06-12" | ||
V2020_08_04 = "2020-08-04" | ||
|
||
|
||
service_version_map = { | ||
"V2019_02_02": ServiceVersion.V2019_02_02, | ||
"V2019_07_07": ServiceVersion.V2019_07_07, | ||
"V2019_10_10": ServiceVersion.V2019_10_10, | ||
"V2019_12_12": ServiceVersion.V2019_12_12, | ||
"V2020_02_10": ServiceVersion.V2020_02_10, | ||
"V2020_04_08": ServiceVersion.V2020_04_08, | ||
"V2020_06_12": ServiceVersion.V2020_06_12, | ||
"V2020_08_04": ServiceVersion.V2020_08_04, | ||
"LATEST": ServiceVersion.V2020_08_04, | ||
"LATEST_PLUS_1": ServiceVersion.V2020_06_12 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"displayNames": { | ||
"--disablecov": "", | ||
"false": "", | ||
"true": "" | ||
}, | ||
"matrix": { | ||
"Agent": { | ||
"ubuntu-18.04": { "OSVmImage": "MMSUbuntu18.04", "Pool": "azsdk-pool-mms-ubuntu-1804-general" }, | ||
"windows-2019": { "OSVmImage": "MMS2019", "Pool": "azsdk-pool-mms-win-2019-general" }, | ||
"macOS-10.15": { "OSVmImage": "macOS-10.15", "Pool": "Azure Pipelines" } | ||
}, | ||
"PythonVersion": [ "pypy3", "2.7", "3.6", "3.7", "3.8", "3.9" ], | ||
"CoverageArg": "--disablecov", | ||
"TestSamples": "false", | ||
"AZURE_LIVE_TEST_SERVICE_VERSION": [ | ||
"V2019_02_02", | ||
"V2019_07_07", | ||
"V2019_12_12", | ||
"V2020_02_10", | ||
"V2020_04_08", | ||
"V2020_06_12", | ||
"V2020_08_04" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters