Skip to content

Commit 6704217

Browse files
authored
airbyte-ci: improve error handling in live tests (#44118)
1 parent c31dab8 commit 6704217

File tree

3 files changed

+22
-13
lines changed

3 files changed

+22
-13
lines changed

airbyte-ci/connectors/pipelines/README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -789,8 +789,9 @@ airbyte-ci connectors --language=low-code migrate-to-manifest-only
789789
## Changelog
790790

791791
| Version | PR | Description |
792-
| ------- | ---------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
793-
| 4.32.2 | [#43970](https://github.com/airbytehq/airbyte/pull/43970) | Make `connectors publish` early exit if no connectors are selected. |
792+
|---------| ---------------------------------------------------------- |------------------------------------------------------------------------------------------------------------------------------|
793+
| 4.32.3 | [#44118](https://github.com/airbytehq/airbyte/pull/44118) | Improve error handling in live tests. |
794+
| 4.32.2 | [#43970](https://github.com/airbytehq/airbyte/pull/43970) | Make `connectors publish` early exit if no connectors are selected. |
794795
| 4.32.1 | [#41642](https://github.com/airbytehq/airbyte/pull/41642) | Avoid transient publish failures by increasing `POETRY_REQUESTS_TIMEOUT` and setting retries on `PublishToPythonRegistry`. |
795796
| 4.32.0 | [#43969](https://github.com/airbytehq/airbyte/pull/43969) | Add an `--ignore-connector` option to `up-to-date` |
796797
| 4.31.5 | [#43934](https://github.com/airbytehq/airbyte/pull/43934) | Track deleted files when generating pull-request |

airbyte-ci/connectors/pipelines/pipelines/airbyte_ci/connectors/test/steps/common.py

+18-10
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from textwrap import dedent
1616
from typing import Any, ClassVar, Dict, List, Optional, Set
1717

18+
import dagger
1819
import requests # type: ignore
1920
import semver
2021
import yaml # type: ignore
@@ -649,18 +650,25 @@ async def _run(self, connector_under_test_container: Container) -> StepResult:
649650

650651
exit_code, stdout, stderr = await get_exec_result(container)
651652

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
656668
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,
658671
)
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()
664672

665673
return StepResult(
666674
step=self,

airbyte-ci/connectors/pipelines/pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
44

55
[tool.poetry]
66
name = "pipelines"
7-
version = "4.32.2"
7+
version = "4.32.3"
88
description = "Packaged maintained by the connector operations team to perform CI for connectors' pipelines"
99
authors = ["Airbyte <[email protected]>"]
1010

0 commit comments

Comments
 (0)