Skip to content

fix: allow S3 test to pass regardless of AWS config - #21499

Merged
jnewbigin merged 1 commit into
mainfrom
jnewbigin/test-ignore-aws-config
Apr 10, 2026
Merged

fix: allow S3 test to pass regardless of AWS config#21499
jnewbigin merged 1 commit into
mainfrom
jnewbigin/test-ignore-aws-config

Conversation

@jnewbigin

@jnewbigin jnewbigin commented Apr 10, 2026

Copy link
Copy Markdown
Contributor

Users with invalid AWS config profile may be unable to run tests. This makes the tests more independent

What this PR does / why we need it:
The grafana tooling rewrites the AWS config file in a way which is not compatible with the loki S3 storage test.

This PR removes the external dependency making the test more pure/independent of it's environment.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Checklist

  • Reviewed the CONTRIBUTING.md guide (required)
  • Documentation added
  • Tests updated
  • Title matches the required conventional commits format, see here
  • Changes that require user attention or interaction to upgrade are documented in docs/sources/setup/upgrade/_index.md
  • If the change is deprecating or removing a configuration option, update the deprecated-config.yaml and deleted-config.yaml files respectively in the tools/deprecated-config-checker directory. Example PR

Note

Low Risk
Low risk: test-only change that forces AWS SDK config/credentials files to /dev/null to avoid failures from invalid local AWS profiles.

Overview
Adds a TestMain in s3_storage_client_test.go that sets AWS_CONFIG_FILE and AWS_SHARED_CREDENTIALS_FILE to /dev/null before running the suite, preventing S3 client tests from reading (and potentially failing on) the developer machine’s AWS configuration.

Reviewed by Cursor Bugbot for commit 73058d1. Bugbot is set up for automated code reviews on this repo. Configure here.

@jnewbigin
jnewbigin requested a review from a team as a code owner April 10, 2026 02:21
Users with invalid AWS config profile may be unable to run tests.
This makes the tests more independent
@jnewbigin
jnewbigin force-pushed the jnewbigin/test-ignore-aws-config branch from ae1074c to 73058d1 Compare April 10, 2026 02:23
@jnewbigin
jnewbigin merged commit 5fda167 into main Apr 10, 2026
85 checks passed
@jnewbigin
jnewbigin deleted the jnewbigin/test-ignore-aws-config branch April 10, 2026 08:46
chaudum added a commit that referenced this pull request Apr 10, 2026
Follow up on #21499

The test suite would fail in case the AWS_PROFILE environment variable
is set on the host that references a profile, which cannot be present,
because of AWS_CONFIG_FILE being empty.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2 participants