Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{Script} Add retry in get_whl_from_url and only verify latest version of an extension #2987

Merged
merged 8 commits into from
Feb 10, 2021
Prev Previous commit
Next Next commit
test all versions of some extensions
  • Loading branch information
fengzhou-msft committed Feb 9, 2021
commit d3d78d79916f4a5993f4200771839f2eef6756d7
11 changes: 7 additions & 4 deletions scripts/ci/test_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@

from util import get_ext_metadata, get_whl_from_url, get_index_data, verify_dependency

# Some extensions are published through manually submitted PRs and the latest version may not be in the end of
# the version list in index.json. Let's just test all versions for these extensions.
EXTS_TEST_ALL_VERSIONS = set('azure-cli-ml', 'alias', 'azure_iot')

def get_sha256sum(a_file):
sha256 = hashlib.sha256()
Expand Down Expand Up @@ -106,10 +109,10 @@ def test_filename_duplicates(self):
@unittest.skipUnless(os.getenv('CI'), 'Skipped as not running on CI')
def test_checksums(self):
for exts in self.index['extensions'].values():
end = len(exts) -1
end = len(exts) - 1
for index, item in enumerate(exts):
fengzhou-msft marked this conversation as resolved.
Show resolved Hide resolved
# only test the latest version
if index < end:
if index < end and ext_name not in EXTS_TEST_ALL_VERSIONS:
continue
ext_file = get_whl_from_url(item['downloadUrl'], item['filename'],
self.whl_cache_dir, self.whl_cache)
Expand Down Expand Up @@ -137,10 +140,10 @@ def test_metadata(self):

extensions_dir = tempfile.mkdtemp()
for ext_name, exts in self.index['extensions'].items():
end = len(exts) -1
end = len(exts) - 1
for index, item in enumerate(exts):
# only test the latest version
if index < end:
if index < end and ext_name not in EXTS_TEST_ALL_VERSIONS:
continue
ext_dir = tempfile.mkdtemp(dir=extensions_dir)
ext_file = get_whl_from_url(item['downloadUrl'], item['filename'],
Expand Down