From 1449235cb7ed99732894b9990bb637ed9976e79d Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Tue, 20 Oct 2026 15:20:13 +0000 Subject: [PATCH 1/2] fix(standard-tests): pass --config when the scenario's config is an empty object Co-Authored-By: bot_apk --- .../test/standard_tests/_job_runner.py | 3 +- unit_tests/test/test_job_runner_config.py | 93 +++++++++++++++++++ 2 files changed, 95 insertions(+), 1 deletion(-) create mode 100644 unit_tests/test/test_job_runner_config.py diff --git a/airbyte_cdk/test/standard_tests/_job_runner.py b/airbyte_cdk/test/standard_tests/_job_runner.py index 3bb0ea470..07be77420 100644 --- a/airbyte_cdk/test/standard_tests/_job_runner.py +++ b/airbyte_cdk/test/standard_tests/_job_runner.py @@ -75,7 +75,8 @@ def run_test_job( empty_if_missing=True, connector_root=connector_root, ) - if config_dict and verb != "spec": + has_config = test_scenario.config_dict is not None or test_scenario.config_path is not None + if verb != "spec" and (config_dict or has_config): # Write the config to a temp json file and pass the path to the file as an argument. config_path = ( Path(tempfile.gettempdir()) / "airbyte-test" / f"temp_config_{uuid.uuid4().hex}.json" diff --git a/unit_tests/test/test_job_runner_config.py b/unit_tests/test/test_job_runner_config.py new file mode 100644 index 000000000..47de85253 --- /dev/null +++ b/unit_tests/test/test_job_runner_config.py @@ -0,0 +1,93 @@ +from pathlib import Path +from typing import Any + +import pytest + +from airbyte_cdk.test import entrypoint_wrapper +from airbyte_cdk.test.entrypoint_wrapper import EntrypointOutput +from airbyte_cdk.test.models.scenario import ConnectorTestScenario +from airbyte_cdk.test.standard_tests._job_runner import run_test_job + + +def _run_test_job_args( + monkeypatch: pytest.MonkeyPatch, + tmp_path: Path, + scenario: ConnectorTestScenario, + verb: str = "discover", +) -> list[str]: + captured_args: list[str] = [] + + def fake_run_command( + *, + source: Any, + args: list[str], + expected_outcome: Any, + ) -> EntrypointOutput: + captured_args.extend(args) + return EntrypointOutput(messages=[], command=args) + + monkeypatch.setattr(entrypoint_wrapper, "_run_command", fake_run_command) + run_test_job( + lambda: object(), + verb, # type: ignore[arg-type] + connector_root=tmp_path, + test_scenario=scenario, + ) + return captured_args + + +def test_config_path_with_empty_object_passes_config( + monkeypatch: pytest.MonkeyPatch, + tmp_path: Path, +) -> None: + config_path = tmp_path / "config.json" + config_path.write_text("{}") + + args = _run_test_job_args( + monkeypatch, + tmp_path, + ConnectorTestScenario(config_path=config_path), + ) + + assert "--config" in args + config_index = args.index("--config") + 1 + assert Path(args[config_index]).read_text() == "{}" + + +def test_config_dict_passes_config( + monkeypatch: pytest.MonkeyPatch, + tmp_path: Path, +) -> None: + args = _run_test_job_args( + monkeypatch, + tmp_path, + ConnectorTestScenario(config_dict={"a": 1}), + ) + + assert "--config" in args + + +def test_missing_config_does_not_pass_config( + monkeypatch: pytest.MonkeyPatch, + tmp_path: Path, +) -> None: + args = _run_test_job_args(monkeypatch, tmp_path, ConnectorTestScenario()) + + assert "--config" not in args + + +def test_spec_does_not_pass_config( + monkeypatch: pytest.MonkeyPatch, + tmp_path: Path, +) -> None: + config_path = tmp_path / "config.json" + config_path.write_text("{}") + + args = _run_test_job_args( + monkeypatch, + tmp_path, + ConnectorTestScenario(config_path=config_path), + verb="spec", + ) + + assert "--config" not in args From 032977537d24d804759889f845c609dc04892bf8 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Tue, 20 Oct 2026 15:24:13 +0000 Subject: [PATCH 2/2] test(standard-tests): remove unnecessary connector lambda Co-Authored-By: bot_apk --- unit_tests/test/test_job_runner_config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unit_tests/test/test_job_runner_config.py b/unit_tests/test/test_job_runner_config.py index 47de85253..93df70655 100644 --- a/unit_tests/test/test_job_runner_config.py +++ b/unit_tests/test/test_job_runner_config.py @@ -28,7 +28,7 @@ def fake_run_command( monkeypatch.setattr(entrypoint_wrapper, "_run_command", fake_run_command) run_test_job( - lambda: object(), + object, # type: ignore[arg-type] verb, # type: ignore[arg-type] connector_root=tmp_path, test_scenario=scenario,