Skip to content

Commit 79de4f1

Browse files
rstrahanclaude
andcommitted
test(queue_sender): stop the reupload-cleanup tests depending on an ambient region
CI fails these 8 tests with `botocore.exceptions.NoRegionError`. `index.py` builds its sqs/s3/cloudwatch clients at module scope, and the `mock_env` fixture set every other environment variable the module needs but not a region — so the tests silently inherited one from the developer's environment, passed locally, and failed in CI. Reproduced under CI conditions locally (region, profile and credential files all unset): 8 failed before, 8 pass after, and they still pass with a region present. Not caused by this PR — it blocks it. The test workflow runs on pull requests only, so a push to develop does not run the suite, which is how it got in. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 8742fcb commit 79de4f1

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/lambda/queue_sender/test_index.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ def mock_env():
3030
"OUTPUT_BUCKET": "test-output-bucket",
3131
"CONFIG_TABLE": "test-config-table",
3232
"LOG_LEVEL": "INFO",
33+
# index.py builds boto3 clients (sqs/s3/cloudwatch) which need a region.
34+
# Without this the tests inherit one from the developer's environment and
35+
# pass locally, then fail in CI with NoRegionError — which is exactly what
36+
# happened. A unit test must not depend on ambient AWS configuration.
37+
"AWS_DEFAULT_REGION": "us-east-1",
3338
}
3439
with patch.dict(os.environ, env_vars):
3540
yield

0 commit comments

Comments
 (0)