Fixed KMS master key provider tests when default AWS region is configured by ragona · Pull Request #179 · aws/aws-encryption-sdk-python (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

ragona merged 3 commits intoaws:masterfromragona:default-region-test-fixes

Aug 2, 2019

Conversation15 Commits3 Checks0 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

ragona

This fixes issue #31, in which users who have configured a default AWS region (either via ~/.aws/config or via environment variable) will experience failing tests for KMSMasterKeyProvider. I tried to keep the tests mostly unchanged, but in some cases I elected to simply skip them since the test didn't provide much value if there was already a default value configured.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ragona

mattsb42-aws

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

General note: reading back through these, the intent of some of these tests are a bit difficult to determine. Feel free to rename any tests if you think a different name would better communicate their intent.

@ragona

ragona

@ragona

Thanks for the very helpful comments, @mattsb42-aws! I think I've responded to all of your comments with a much-improved way to fix this that doesn't involve skipping any tests. I'm not sure if I followed the general best practices and conventions for creating that fixture though, so definitely looking for feedback on general style.

mattsb42-aws

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this, but there's one thing I want to add to it before merging.
I want to make sure that we are testing everything in this module both with a default region set and not set to make sure that we do not regress.

For simplicity, I'm just going to push a commit to your branch, because this gets a bit into dark pytest magics.

@mattsb42-aws

…gainst both with and without default region

mattsb42-aws

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming Travis passes, this LGTM.

@ragona before merging, please take a look at the fixture I added and make sure it makes sense to you. If not, we'll expand docs/etc before merging.

mattsb42-aws added a commit that referenced this pull request

Oct 4, 2019

@mattsb42-aws

Co-Authored-By: Matt Bullock bullocm@amazon.com

mattsb42-aws added a commit that referenced this pull request

Mar 12, 2020

Co-Authored-By: Matt Bullock bullocm@amazon.com

Co-Authored-By: June Blender juneb@users.noreply.github.com

Co-Authored-By: June Blender juneb@users.noreply.github.com

Co-Authored-By: June Blender juneb@users.noreply.github.com

Co-authored-by: John Walker jhwal@amazon.com Co-authored-by: Caitlin Tibbetts caitlin@tibbettsfamily.com Co-authored-by: Caitlin Tibbetts tibbetc@amazon.com Co-authored-by: Ryan Ragona ryanragona@gmail.com Co-authored-by: lizroth 30636882+lizroth@users.noreply.github.com Co-authored-by: June Blender juneb@users.noreply.github.com

2 participants

@ragona @mattsb42-aws