-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
Allow running tests when AWS_PROFILE is set, needed for STS users #6383
Conversation
…ing testing when AWS_PROFILE is set without AWS_SECRET_ACCESS_KEY and AWS_ACCESS_KEY_ID.
} | ||
if v := os.Getenv("AWS_SECRET_ACCESS_KEY"); v == "" { | ||
t.Fatal("AWS_SECRET_ACCESS_KEY must be set for acceptance tests") | ||
if v := os.Getenv("AWS_PROFILE"); v == "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the normal precedence of profile vs keys set explicitly? If so, this LGTM - if not we should probably reverse it to work the same way as the AWS CLI?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested this and it goes with the keys first. I'll make some adjustments
Hi @bigkraig! I've left a question inline in the code, but this looks good to me at least in principle! |
Related: #5019 |
@jen20 I started to work on this and realized it may not be necessary. The client is still going to use the same variables it was using before. Case 1: Case 2: Case 3: Case 4: Case 5: |
Thanks for the clarification @bigkraig! About to merge this - personally I'll find it helpful, and it looks like @radeksimko may also! Thanks for your work! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
I don't have a great understanding of how the testing system is set up, I just now learned how to run the acceptance tests with
testacc
andTEST=./builtin/providers/aws
:)A full test without
TESTARGS
will start to throw errors of no valid credentials, but with this patch you can at least test individual resources.