Skip to content

Commit c2db2a5

Browse files
fix(test): allow write access to config file in Docker tests (#879)
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: aldo.gonzalez@airbyte.io <aldo.gonzalez@airbyte.io>
1 parent d85cb1c commit c2db2a5

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

airbyte_cdk/test/models/scenario.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,10 @@ def with_temp_config_file(
143143
) as temp_file:
144144
temp_file.write(json.dumps(config))
145145
temp_file.flush()
146-
# Allow the file to be read by other processes
146+
# Allow the file to be read and written by other processes
147+
# Write access is needed for connectors with config migration (e.g., OAuth token refresh)
147148
temp_path = Path(temp_file.name)
148-
temp_path.chmod(temp_path.stat().st_mode | 0o444)
149+
temp_path.chmod(temp_path.stat().st_mode | 0o666)
149150
yield temp_path
150151

151152
# attempt cleanup, ignore errors

airbyte_cdk/test/standard_tests/docker_base.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ def test_docker_image_build_and_check(
243243
"run",
244244
"--rm",
245245
"-v",
246-
f"{temp_config_file}:{container_config_path}",
246+
f"{temp_config_file}:{container_config_path}:rw",
247247
connector_image,
248248
"check",
249249
"--config",
@@ -336,7 +336,7 @@ def test_docker_image_build_and_read(
336336
"run",
337337
"--rm",
338338
"-v",
339-
f"{temp_config_file}:{container_config_path}",
339+
f"{temp_config_file}:{container_config_path}:rw",
340340
connector_image,
341341
"discover",
342342
"--config",
@@ -393,7 +393,7 @@ def test_docker_image_build_and_read(
393393
"run",
394394
"--rm",
395395
"-v",
396-
f"{temp_config_file}:{container_config_path}",
396+
f"{temp_config_file}:{container_config_path}:rw",
397397
"-v",
398398
f"{configured_catalog_path}:{container_catalog_path}",
399399
connector_image,

0 commit comments

Comments
 (0)