{CI} Enable incremental test on commnad modules only#12657
Conversation
|
incremental test |
| else: | ||
| test_paths = set() | ||
| for mod in modified_modules: | ||
| try: | ||
| test_paths.add(os.path.normpath(test_index[mod])) | ||
| except KeyError: | ||
| display("no tests found in module: {}".format(mod)) | ||
| args.tests = test_paths | ||
|
|
||
| selected_modules = [] |
There was a problem hiding this comment.
In the below code, both selected_modules and args.tests are set, but here you cleaned selected_modules instead of setting to modified_modules. What's the difference?
azure-cli/tools/automation/tests/__init__.py
Lines 133 to 157 in a590a30
There was a problem hiding this comment.
The selected_modules is a list of tuple which consist of 3 elements, like:
azure-cli/tools/automation/tests/__init__.py
Lines 43 to 44 in 450f751
The last element of the tuple is a Python Namesapce.
In the incremental test case, I identify module from modified files and then extract module name from it.
So the modified_modules is a list of Python module name like core, vm, storage.
Then I extract corresponding tests from testIndex.json which is generated from get_test_index().
In the runner:
azure-cli/tools/automation/tests/main.py
Lines 15 to 38 in 450f751
tests has higher priority than the module.
So, when I have the extract test need to run, no need to provide selected_module.
Scenario of modified files:
src/azure-cli-core/azure/cli/core([CI] Incremental test on modifying core #12658) - 83minssrc/azure-cli-telemetry/([CI] test on modifying telemetry #12662) - 53minssrc/azure-cli/azure/cli/command_modules/network([CI] incremental test on modifying network test #12661) take 11 mins.srv/azure-cli/azure/cli/command_modules/vm([CI] incremental test on modifying vm test #12664) take 11 mins.src/azure-cli-testsdk/([CI] Incremental test on modifying testsdk #12666) - 48minsThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.