Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions scripts/ci/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
SRC_PATH = os.path.join(get_repo_root(), 'src')

# Extensions to skip dep. check. Aim to keep this list empty.
SKIP_DEP_CHECK = ['azure_cli_iot_ext']
SKIP_DEP_CHECK = ['azure-cli-iot-ext']


def catch_dup_keys(pairs):
Expand Down Expand Up @@ -102,7 +102,7 @@ def get_ext_metadata(ext_dir, ext_file, ext_name):
metadata.update(azext_metadata)
for dist_info_dirname in dist_info_dirs:
parsed_dist_info_dir = WHEEL_INFO_RE(dist_info_dirname)
if parsed_dist_info_dir and parsed_dist_info_dir.groupdict().get('name') == ext_name:
if parsed_dist_info_dir and parsed_dist_info_dir.groupdict().get('name') == ext_name.replace('-', '_'):
whl_metadata_filepath = os.path.join(ext_dir, dist_info_dirname, WHL_METADATA_FILENAME)
if os.path.isfile(whl_metadata_filepath):
with open(whl_metadata_filepath) as f:
Expand Down Expand Up @@ -134,11 +134,15 @@ def test_format_extensions_value(self):

def test_extension_filenames(self):
for ext_name, exts in self.index['extensions'].items():
self.assertEqual(ext_name.find('_'), -1, "Extension names should not contain underscores. "
"Found {}".format(ext_name))
for item in exts:
self.assertTrue(item['filename'].endswith('.whl'),
"Filename {} must end with .whl".format(item['filename']))
self.assertTrue(item['filename'].startswith(ext_name),
"Filename {} must start with {}".format(item['filename'], ext_name))
self.assertEqual(ext_name, item['metadata']['name'],
"Extension name mismatch in extensions['{}']. "
"Found an extension in the list with name "
"{}".format(ext_name, item['metadata']['name']))
parsed_filename = WHEEL_INFO_RE(item['filename'])
p = parsed_filename.groupdict()
self.assertTrue(p.get('name'), "Can't get name for {}".format(item['filename']))
Expand Down Expand Up @@ -224,6 +228,8 @@ def test_source_wheels(self):
source_extensions = [os.path.join(SRC_PATH, n) for n in os.listdir(SRC_PATH)
if os.path.isdir(os.path.join(SRC_PATH, n))]
for s in source_extensions:
if not os.path.isfile(os.path.join(s, 'setup.py')):
continue
try:
subprocess.check_call(['python', 'setup.py', 'bdist_wheel', '-q', '-d', built_whl_dir],
cwd=s, stdout=PIPE, stderr=PIPE)
Expand Down
6 changes: 3 additions & 3 deletions src/index.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"formatVersion": "1",
"extensions": {
"azure_batch_cli_extensions": [
"azure-batch-cli-extensions": [
{
"filename": "azure_batch_cli_extensions-2.0.0-py2.py3-none-any.whl",
"sha256Digest": "ccdfd15a2a33e2f3298e64051f556da76d7bec6e1008fd28a6467803df8ae8cb",
Expand Down Expand Up @@ -35,7 +35,7 @@
}
}
],
"azure_cli_iot_ext": [
"azure-cli-iot-ext": [
{
"filename": "azure_cli_iot_ext-0.1.1-py2.py3-none-any.whl",
"sha256Digest": "28f5565fa0367da4694223bb8dfacd68be5213e6a49b3a463a10c2379c39da19",
Expand Down Expand Up @@ -94,7 +94,7 @@
}
}
],
"image_copy_extension": [
"image-copy-extension": [
{
"filename": "image_copy_extension-0.0.4-py2.py3-none-any.whl",
"sha256Digest": "47d0f4293e833bb16bac1abbc63f7946dd87ac8db40378a230ec376d1f128fd3",
Expand Down