From fed6158f35335c10380d1db982a53e6b7c61059e Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Fri, 16 Jan 2026 01:49:08 +0000 Subject: [PATCH] fix(test): allow write access to config file in Docker tests Connectors with config migration (e.g., OAuth token refresh) need write access to the config file during tests. This change: 1. Updates temp config file permissions from 0o444 (read-only) to 0o666 (read-write) in scenario.py 2. Adds explicit :rw flag to Docker volume mounts in docker_base.py This fixes PermissionError when testing connectors that use _migrate_and_transform_config to persist config changes. Co-Authored-By: aldo.gonzalez@airbyte.io --- airbyte_cdk/test/models/scenario.py | 5 +++-- airbyte_cdk/test/standard_tests/docker_base.py | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/airbyte_cdk/test/models/scenario.py b/airbyte_cdk/test/models/scenario.py index 2704f6e96..ddd99ef74 100644 --- a/airbyte_cdk/test/models/scenario.py +++ b/airbyte_cdk/test/models/scenario.py @@ -143,9 +143,10 @@ def with_temp_config_file( ) as temp_file: temp_file.write(json.dumps(config)) temp_file.flush() - # Allow the file to be read by other processes + # Allow the file to be read and written by other processes + # Write access is needed for connectors with config migration (e.g., OAuth token refresh) temp_path = Path(temp_file.name) - temp_path.chmod(temp_path.stat().st_mode | 0o444) + temp_path.chmod(temp_path.stat().st_mode | 0o666) yield temp_path # attempt cleanup, ignore errors diff --git a/airbyte_cdk/test/standard_tests/docker_base.py b/airbyte_cdk/test/standard_tests/docker_base.py index bc26802dd..e3e196ce1 100644 --- a/airbyte_cdk/test/standard_tests/docker_base.py +++ b/airbyte_cdk/test/standard_tests/docker_base.py @@ -243,7 +243,7 @@ def test_docker_image_build_and_check( "run", "--rm", "-v", - f"{temp_config_file}:{container_config_path}", + f"{temp_config_file}:{container_config_path}:rw", connector_image, "check", "--config", @@ -336,7 +336,7 @@ def test_docker_image_build_and_read( "run", "--rm", "-v", - f"{temp_config_file}:{container_config_path}", + f"{temp_config_file}:{container_config_path}:rw", connector_image, "discover", "--config", @@ -393,7 +393,7 @@ def test_docker_image_build_and_read( "run", "--rm", "-v", - f"{temp_config_file}:{container_config_path}", + f"{temp_config_file}:{container_config_path}:rw", "-v", f"{configured_catalog_path}:{container_catalog_path}", connector_image,