Use the given build_target to run execution's test suites with possibly only a subset of test cases. If no subset is specified, run all test cases.
(
sut_node: SutNode,
tg_node: TGNode,
execution: ExecutionConfiguration,
build_target_result: BuildTargetResult,
)
| 151 | |
| 152 | |
| 153 | def _run_all_suites( |
| 154 | sut_node: SutNode, |
| 155 | tg_node: TGNode, |
| 156 | execution: ExecutionConfiguration, |
| 157 | build_target_result: BuildTargetResult, |
| 158 | ) -> None: |
| 159 | """ |
| 160 | Use the given build_target to run execution's test suites |
| 161 | with possibly only a subset of test cases. |
| 162 | If no subset is specified, run all test cases. |
| 163 | """ |
| 164 | end_build_target = False |
| 165 | if not execution.skip_smoke_tests: |
| 166 | execution.test_suites[:0] = [TestSuiteConfig.from_dict("smoke_tests")] |
| 167 | for test_suite_config in execution.test_suites: |
| 168 | try: |
| 169 | _run_single_suite(sut_node, tg_node, execution, build_target_result, test_suite_config) |
| 170 | except BlockingTestSuiteError as e: |
| 171 | dts_logger.exception( |
| 172 | f"An error occurred within {test_suite_config.test_suite}. Skipping build target." |
| 173 | ) |
| 174 | result.add_error(e) |
| 175 | end_build_target = True |
| 176 | # if a blocking test failed and we need to bail out of suite executions |
| 177 | if end_build_target: |
| 178 | break |
| 179 | |
| 180 | |
| 181 | def _run_single_suite( |
no test coverage detected