Skip to content

azdev test fails in pycharm due to a wrong profile #134

@bim-msft

Description

@bim-msft

I'm using azdev test in pycharm to do some tests, but I've noticed the following error:

fore_red = colorama.Fore.RED if not IS_WINDOWS else ''
fore_reset = colorama.Fore.RESET if not IS_WINDOWS else ''
original_profile = raw_cmd('az cloud show --query profile -otsv', show_stderr=False).result
if not profile or original_profile == profile:
profile = original_profile
display('The tests are set to run against current profile {}.'
.format(fore_red + original_profile + fore_reset))

azdev_test_bug1

The profile is latest\r\n\x1b[0m.

Finally the process fails with the following exception:
[WinError 123] The filename, directory name, or volume label syntax is incorrect: 'd:\\repos\\azure-cli\\src\\azure-cli\\azure\\cli\\command_modules\\acr\\tests\\latest\r\n\x1b[0m' Traceback (most recent call last): File "D:\repos\env3\lib\site-packages\knack\cli.py", line 206, in invoke cmd_result = self.invocation.execute(args) File "D:\repos\env3\lib\site-packages\knack\invocation.py", line 208, in execute cmd_result = parsed_args.func(params) File "D:\repos\env3\lib\site-packages\knack\commands.py", line 139, in __call__ return self.handler(*args, **kwargs) File "D:\repos\env3\lib\site-packages\knack\commands.py", line 246, in _command_handler result = op(client, **command_args) if client else op(**command_args) File "D:\repos\azure-cli-dev-tools\azdev\operations\tests\__init__.py", line 48, in run_tests test_index = _get_test_index(profile, discover) File "D:\repos\azure-cli-dev-tools\azdev\operations\tests\__init__.py", line 351, in _get_test_index test_index = _discover_tests(profile) File "D:\repos\azure-cli-dev-tools\azdev\operations\tests\__init__.py", line 262, in _discover_tests tests = _discover_module_tests(mod_name, mod_data) File "D:\repos\azure-cli-dev-tools\azdev\operations\tests\__init__.py", line 179, in _discover_module_tests contents = os.listdir(mod_data['filepath']) OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: 'd:\\repos\\azure-cli\\src\\azure-cli\\azure\\cli\\command_modules\\acr\\tests\\latest\r\n\x1b[0m'

Metadata

Metadata

Labels

Testazdev test

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions