Skip to content

Add Unit test for KeyPair step#181

Merged
JenGoldstrich merged 13 commits intomainfrom
step-key-pair-test
Jan 21, 2022
Merged

Add Unit test for KeyPair step#181
JenGoldstrich merged 13 commits intomainfrom
step-key-pair-test

Conversation

@JenGoldstrich
Copy link
Copy Markdown
Contributor

After reviewing #179 with Wilken we came to the conclusion that we should add a unit test to the KeyPair step so that the aforementioned PR can be tested (just need to remove comments in step_key_pair_test)

I ended up having to make a small change to each builder to put the region in the state before the steps are run, previously step_key_pair would access Region through the ec2 object (ec2conn.Config.Region), since we now cast that as an ec2iface to be able to mock it in the test, we are no longer able to access the Config object within the step, since the interface does not know about the Config object (might be an upstream fix there)

@JenGoldstrich JenGoldstrich requested a review from a team as a code owner January 21, 2022 00:30
Copy link
Copy Markdown
Contributor

@nywilken nywilken left a comment

Choose a reason for hiding this comment

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

I left a couple of suggestions but otherwise looks good.

JenGoldstrich and others added 7 commits January 21, 2022 08:42
Copy link
Copy Markdown
Contributor

@nywilken nywilken left a comment

Choose a reason for hiding this comment

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

Happy we were able to talk abit about the changes. Approving, feel free to merge when ready.

Wilken Rivera and others added 2 commits January 21, 2022 14:06
* Add basic acceptance test

* Add test fixture

* Remove function for describing key pairs

* Rename ebs example test to RSA

Co-authored-by: Jenna Goldstrich <jenna.goldstrich@hashicorp.com>
@JenGoldstrich
Copy link
Copy Markdown
Contributor Author

Didn't realize that #182 was targeted at this PR's branch (step-key-pair-test), merging this now to merge both PRs

I ran acceptance tests, and things hang on a test for me, but they hang on the same test on the main branch for me as well, I think this is due to my setup, the test we added works which I think would validate that we haven't broken anything with this change.

@JenGoldstrich JenGoldstrich merged commit 06fe648 into main Jan 21, 2022
@JenGoldstrich JenGoldstrich deleted the step-key-pair-test branch January 21, 2022 23:58
@azr azr added the tech-debt label Jan 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants