Skip to content

{testsdk} Include azure.cli.testsdk.scenario_tests in wheel#20698

Merged
jiasli merged 1 commit intoAzure:devfrom
jiasli:scenario_tests
Dec 13, 2021
Merged

{testsdk} Include azure.cli.testsdk.scenario_tests in wheel#20698
jiasli merged 1 commit intoAzure:devfrom
jiasli:scenario_tests

Conversation

@jiasli
Copy link
Member

@jiasli jiasli commented Dec 13, 2021

Description

After

CI fails:

https://dev.azure.com/azure-sdk/public/_build/results?buildId=1244125&view=logs&jobId=c846b3e8-69b8-5dbd-1a39-4905d81e6a95&j=c846b3e8-69b8-5dbd-1a39-4905d81e6a95&t=9ebb608a-8a51-5834-bad0-46e2c03d2282

==================================== ERRORS ====================================
_________ ERROR collecting tests/latest/test_acr_agentpool_commands.py _________
ImportError while importing test module '/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/acr/tests/latest/test_acr_agentpool_commands.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/opt/az/lib/python3.6/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/acr/tests/latest/test_acr_agentpool_commands.py:6: in <module>
    from azure.cli.testsdk import ScenarioTest, StorageAccountPreparer, ResourceGroupPreparer, record_only
/opt/az/lib/python3.6/site-packages/azure/cli/testsdk/__init__.py:6: in <module>
    from .scenario_tests import live_only, record_only, get_sha1_hash
E   ModuleNotFoundError: No module named 'azure.cli.testsdk.scenario_tests'

This is because azure.cli.testsdk.scenario_tests is missing from the built wheel.

Adding it to setup.py.

@jiasli jiasli changed the title {testsdk} Including azure.cli.testsdk.scenario_tests in wheel {testsdk} Include azure.cli.testsdk.scenario_tests in wheel Dec 13, 2021
Copy link
Contributor

@zhoxing-ms zhoxing-ms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just out of curiosity, may I ask why azure.cli.testsdk.scenario_tests is not included in azure.cli.testsdk?

@jiasli
Copy link
Member Author

jiasli commented Dec 13, 2021

Just out of curiosity, may I ask why azure.cli.testsdk.scenario_tests is not included in azure.cli.testsdk?

Simply because it is not defined in packages. azure-cli uses find_packages instead to find all packages.

packages=find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests", "azure", "azure.cli"]),

@jiasli jiasli merged commit eabfd1f into Azure:dev Dec 13, 2021
@jiasli jiasli deleted the scenario_tests branch December 13, 2021 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants