|
15 | 15 | from textwrap import dedent
|
16 | 16 | from typing import Any, ClassVar, Dict, List, Optional, Set
|
17 | 17 |
|
| 18 | +import dagger |
18 | 19 | import requests # type: ignore
|
19 | 20 | import semver
|
20 | 21 | import yaml # type: ignore
|
@@ -649,18 +650,25 @@ async def _run(self, connector_under_test_container: Container) -> StepResult:
|
649 | 650 |
|
650 | 651 | exit_code, stdout, stderr = await get_exec_result(container)
|
651 | 652 |
|
652 |
| - if ( |
653 |
| - f"session_{self.run_id}" not in await container.directory(f"{tests_artifacts_dir}").entries() |
654 |
| - or "report.html" not in await container.directory(f"{tests_artifacts_dir}/session_{self.run_id}").entries() |
655 |
| - ): |
| 653 | + try: |
| 654 | + if ( |
| 655 | + f"session_{self.run_id}" not in await container.directory(f"{tests_artifacts_dir}").entries() |
| 656 | + or "report.html" not in await container.directory(f"{tests_artifacts_dir}/session_{self.run_id}").entries() |
| 657 | + ): |
| 658 | + main_logger.exception( |
| 659 | + "The report file was not generated, an unhandled error likely happened during regression test execution, please check the step stderr and stdout for more details" |
| 660 | + ) |
| 661 | + regression_test_report = None |
| 662 | + else: |
| 663 | + await container.file(path_to_report).export(path_to_report) |
| 664 | + with open(path_to_report, "r") as fp: |
| 665 | + regression_test_report = fp.read() |
| 666 | + except dagger.QueryError as exc: |
| 667 | + regression_test_report = None |
656 | 668 | main_logger.exception(
|
657 |
| - "The report file was not generated, an unhandled error likely happened during regression test execution, please check the step stderr and stdout for more details" |
| 669 | + "The test artifacts directory was not generated, an unhandled error likely happened during setup, please check the step stderr and stdout for more details", |
| 670 | + exc_info=exc, |
658 | 671 | )
|
659 |
| - regression_test_report = None |
660 |
| - else: |
661 |
| - await container.file(path_to_report).export(path_to_report) |
662 |
| - with open(path_to_report, "r") as fp: |
663 |
| - regression_test_report = fp.read() |
664 | 672 |
|
665 | 673 | return StepResult(
|
666 | 674 | step=self,
|
|
0 commit comments