|
7 | 7 | import datetime
|
8 | 8 | import os
|
9 | 9 | import time
|
| 10 | +import traceback |
10 | 11 | from abc import ABC, abstractmethod
|
11 | 12 | from functools import cached_property
|
12 | 13 | from pathlib import Path
|
|
17 | 18 | import semver
|
18 | 19 | import yaml # type: ignore
|
19 | 20 | from dagger import Container, Directory
|
20 |
| -from pipelines import hacks |
| 21 | +from pipelines import hacks, main_logger |
21 | 22 | from pipelines.airbyte_ci.connectors.consts import CONNECTOR_TEST_STEP_ID
|
22 | 23 | from pipelines.airbyte_ci.connectors.context import ConnectorContext
|
23 | 24 | from pipelines.airbyte_ci.steps.docker import SimpleDockerStep
|
@@ -416,12 +417,18 @@ async def _run(self, connector_under_test_container: Container) -> StepResult:
|
416 | 417 | container = container.with_(hacks.never_fail_exec(self.regression_tests_command()))
|
417 | 418 | regression_tests_artifacts_dir = str(self.regression_tests_artifacts_dir)
|
418 | 419 | path_to_report = f"{regression_tests_artifacts_dir}/session_{self.run_id}/report.html"
|
419 |
| - await container.file(path_to_report).export(path_to_report) |
420 | 420 |
|
421 | 421 | exit_code, stdout, stderr = await get_exec_result(container)
|
422 | 422 |
|
423 |
| - with open(path_to_report, "r") as fp: |
424 |
| - regression_test_report = fp.read() |
| 423 | + if "report.html" not in await container.directory(f"{regression_tests_artifacts_dir}/session_{self.run_id}").entries(): |
| 424 | + main_logger.exception( |
| 425 | + "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" |
| 426 | + ) |
| 427 | + regression_test_report = None |
| 428 | + else: |
| 429 | + await container.file(path_to_report).export(path_to_report) |
| 430 | + with open(path_to_report, "r") as fp: |
| 431 | + regression_test_report = fp.read() |
425 | 432 |
|
426 | 433 | return StepResult(
|
427 | 434 | step=self,
|
|
0 commit comments