Skip to content

Commit dc788fa

Browse files
committed
tolerate java destinations with no acceptance test config
1 parent 35546a8 commit dc788fa

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

airbyte_cdk/test/standard_tests/docker_base.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import inspect
77
import shutil
88
import sys
9+
import warnings
910
from pathlib import Path
1011

1112
import pytest
@@ -57,11 +58,23 @@ def get_scenarios(
5758
parametrization of fixtures with arguments from the test class itself.
5859
"""
5960
categories = ["connection", "spec"]
60-
all_tests_config = yaml.safe_load(cls.acceptance_test_config_path.read_text())
61+
try:
62+
acceptance_test_config_path = cls.acceptance_test_config_path
63+
except FileNotFoundError as e:
64+
# Destinations sometimes do not have an acceptance tests file.
65+
warnings.warn(
66+
f"Acceptance test config file not found: {e!s}. "
67+
"No scenarios will be loaded.",
68+
category=UserWarning,
69+
stacklevel=0,
70+
)
71+
return []
72+
73+
all_tests_config = yaml.safe_load(acceptance_test_config_path.read_text())
6174
if "acceptance_tests" not in all_tests_config:
6275
raise ValueError(
63-
f"Acceptance tests config not found in {cls.acceptance_test_config_path}."
64-
f" Found only: {str(all_tests_config)}."
76+
f"Acceptance tests config not found in {acceptance_test_config_path}. "
77+
f"Found only: {all_tests_config!s}."
6578
)
6679

6780
test_scenarios: list[ConnectorTestScenario] = []

0 commit comments

Comments
 (0)