From cd33089a665cc3caa8502e2ccf5259d450994023 Mon Sep 17 00:00:00 2001 From: Alexander Bayandin Date: Thu, 3 Aug 2023 14:44:48 +0100 Subject: [PATCH] test_runner: set AWS credentials for endpoints (#4887) ## Problem If AWS credentials are not set locally (via AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY env vars) `test_remote_library[release-pg15-mock_s3]` test fails with the following error: ``` ERROR could not start the compute node: Failed to download a remote file: Failed to download S3 object: failed to construct request ``` ## Summary of changes - set AWS credentials for endpoints programmatically --- test_runner/fixtures/neon_fixtures.py | 6 +++++- test_runner/regress/test_compatibility.py | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/test_runner/fixtures/neon_fixtures.py b/test_runner/fixtures/neon_fixtures.py index 0a9735ce9e..392c4d4c0b 100644 --- a/test_runner/fixtures/neon_fixtures.py +++ b/test_runner/fixtures/neon_fixtures.py @@ -1595,7 +1595,11 @@ class NeonCli(AbstractNeonCli): if endpoint_id is not None: args.append(endpoint_id) - res = self.raw_cli(args) + s3_env_vars = None + if self.env.remote_storage is not None and isinstance(self.env.remote_storage, S3Storage): + s3_env_vars = self.env.remote_storage.access_env_vars() + + res = self.raw_cli(args, extra_env_vars=s3_env_vars) res.check_returncode() return res diff --git a/test_runner/regress/test_compatibility.py b/test_runner/regress/test_compatibility.py index 754d23a01a..eb26270a5f 100644 --- a/test_runner/regress/test_compatibility.py +++ b/test_runner/regress/test_compatibility.py @@ -337,6 +337,7 @@ def check_neon_works( config.pg_version = pg_version config.initial_tenant = snapshot_config["default_tenant_id"] config.pg_distrib_dir = pg_distrib_dir + config.remote_storage = None # Use the "target" binaries to launch the storage nodes config_target = config