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

add helpers #37

Merged
merged 12 commits into from
Jun 23, 2017
Merged

add helpers #37

merged 12 commits into from
Jun 23, 2017

Conversation

mcalhoun
Copy link
Contributor

No description provided.

@mcalhoun mcalhoun changed the title [WIP] add helpers add helpers Jun 22, 2017
@mcalhoun
Copy link
Contributor Author

@josh-padnick @brikis98 please review and let me know if you have comments

Copy link
Member

@brikis98 brikis98 left a comment

Choose a reason for hiding this comment

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

This is a great addition, thx!

aws/sqs.go Outdated

// Waits to receive a message from on the queueUrl. Since the API only allows us to wait a max 20 seconds for a new
// message to arrive, we must loop TIMEOUT/20 number of times to be able to wait for a total of TIMEOUT seconds
func WaitForQueueMessage(awsRegion string, queueUrl string, timeout int) (string, string, error) {
Copy link
Member

Choose a reason for hiding this comment

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

It's not obvious what the two returned strings are. At a minimum, comment it. Better yet would be to wrap it in a struct with named params.

func CreateBaseRandomResourceCollection(t *testing.T, requireNatGateway bool) *terratest.RandomResourceCollection {
exludedRegions := REGIONS_WITHOUT_T2_NANO

if (requireNatGateway) {
Copy link
Member

Choose a reason for hiding this comment

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

Hm, we also have a case in module-ecs where we exclude specific regions that don't support ECS. Perhaps other similar cases. I wonder if we shouldn't have some sort of bitmask or enum style flag to specify the types of resources you plan to create and the function automatically excludes the appropriate region?

}

// As of 6/9/16, these AWS regions do not support t2.nano instances
var REGIONS_WITHOUT_T2_NANO = []string{
Copy link
Member

Choose a reason for hiding this comment

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

Ah, another option is to define these constants and for the CreateBaseRandomResourceCollection to take in a splat (..) to exclude, which can optionally be left blank.

@mcalhoun mcalhoun merged commit 782c2e3 into master Jun 23, 2017
@mcalhoun mcalhoun deleted the feature/add-helpers branch June 25, 2017 23: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.

2 participants