Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't fail credentials unit tests if credentials are found on a file #2761

Merged
merged 1 commit into from
Aug 23, 2024

Conversation

Madrigal
Copy link
Contributor

My tests were failing locally since I use a script that populates the ~/.aws/credentials file. The tests were pulling these credentials and were failing locally with the following error

2024/08/23 09:43:13 config: go test -tags example,codegen,integration,ec2env,perftest -run NONE ./... =>
--- FAIL: TestResolveCredentialsIMDSClient (0.00s)
    --- FAIL: TestResolveCredentialsIMDSClient/env_var_DISABLED_true (0.00s)
        resolve_credentials_test.go:505: unexpected error: <nil>
    --- FAIL: TestResolveCredentialsIMDSClient/env_var_DISABLED_false (0.00s)
        resolve_credentials_test.go:495: expect error got none
    --- FAIL: TestResolveCredentialsIMDSClient/option_state_enabled_overrides_env_var_DISABLED_true (0.00s)
        resolve_credentials_test.go:495: expect error got none
    --- FAIL: TestResolveCredentialsIMDSClient/option_state_disabled_overrides_env_var_DISABLED_false (0.00s)
        resolve_credentials_test.go:505: unexpected error: <nil>
    --- FAIL: TestResolveCredentialsIMDSClient/default_no_options (0.00s)
        resolve_credentials_test.go:495: expect error got none
    --- FAIL: TestResolveCredentialsIMDSClient/state_enabled (0.00s)
        resolve_credentials_test.go:495: expect error got none
    --- FAIL: TestResolveCredentialsIMDSClient/state_disabled (0.00s)
        resolve_credentials_test.go:505: unexpected error: <nil>

This change sets an empty credentials file source when running these tests

@Madrigal Madrigal requested a review from a team as a code owner August 23, 2024 16:21
@Madrigal Madrigal merged commit 097b04b into main Aug 23, 2024
12 checks passed
@Madrigal Madrigal deleted the fix-dont-fail-test-if-credentials-set branch August 23, 2024 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants