Select module to test through env var (#1979)

This commit is contained in:
Troy Dai 2017-02-06 09:51:57 -08:00 коммит произвёл Travis Prescott
Родитель b0504c3b63
Коммит dfcbce22e1
2 изменённых файлов: 9 добавлений и 2 удалений

Просмотреть файл

@ -48,7 +48,7 @@ def get_nose_runner(report_folder, parallel=True, process_timeout=600, process_r
debug_file = os.path.join(report_folder, name + '-debug.log')
arguments += ['--debug-log={}'.format(debug_file)]
print()
print('\n')
print('<<< Run {} >>>'.format(name))
start = datetime.now()
result = nose.run(argv=arguments)

Просмотреть файл

@ -48,12 +48,19 @@ if __name__ == '__main__':
parse = argparse.ArgumentParser('Test tools')
parse.add_argument('--module', dest='modules', action='append',
help='The modules of which the test to be run. Accept short names, except '
'azure-cli, azure-cli-core and azure-cli-nspkg')
'azure-cli, azure-cli-core and azure-cli-nspkg. The modules list can '
'also be set through environment variable AZURE_CLI_TEST_MODULES. The '
'value should be a string of comma separated module names. The '
'environment variable will be overwritten by command line parameters.')
parse.add_argument('--non-parallel', action='store_true',
help='Not to run the tests in parallel.')
parse.add_argument('--live', action='store_true', help='Run all the tests live.')
args = parse.parse_args()
if not args.modules and os.environ.get('AZURE_CLI_TEST_MODULES', None):
print('Test modules list is parsed from environment variable AZURE_CLI_TEST_MODULES.')
args.modules = [m.strip() for m in os.environ.get('AZURE_CLI_TEST_MODULES').split(',')]
selected_modules = filter_user_selected_modules_with_tests(args.modules)
if not selected_modules:
parse.print_help()