Skip to content

test(e2e): add e2e test for customized resources#1264

Merged
mergify[bot] merged 5 commits intoaws:mainlinefrom
iamhopaul123:e2e/customized-env-resources
Aug 18, 2020
Merged

test(e2e): add e2e test for customized resources#1264
mergify[bot] merged 5 commits intoaws:mainlinefrom
iamhopaul123:e2e/customized-env-resources

Conversation

@iamhopaul123
Copy link
Copy Markdown
Contributor

@iamhopaul123 iamhopaul123 commented Aug 12, 2020

This PR adds e2e test for customized env resources.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@iamhopaul123 iamhopaul123 requested a review from a team as a code owner August 12, 2020 23:21
@iamhopaul123 iamhopaul123 requested a review from bvtujo August 12, 2020 23:21
@iamhopaul123 iamhopaul123 added the do-not-merge Pull requests that mergify shouldn't merge until the requester allows it. label Aug 12, 2020
@iamhopaul123
Copy link
Copy Markdown
Contributor Author

looks like we are doing a release tomorrow. i'll split up this pr and get env init changes out of this one.

@iamhopaul123 iamhopaul123 force-pushed the e2e/customized-env-resources branch 3 times, most recently from 066f613 to 6298792 Compare August 13, 2020 00:29
Comment thread e2e/internal/client/cli.go Outdated
@iamhopaul123 iamhopaul123 force-pushed the e2e/customized-env-resources branch 2 times, most recently from 5057be1 to c419f81 Compare August 13, 2020 16:53
@iamhopaul123 iamhopaul123 changed the title chore(e2e): add e2e test for customized resources test(e2e): add e2e test for customized resources Aug 13, 2020
@iamhopaul123 iamhopaul123 force-pushed the e2e/customized-env-resources branch from 44cda84 to 64f51d8 Compare August 13, 2020 20:47
@iamhopaul123 iamhopaul123 removed the do-not-merge Pull requests that mergify shouldn't merge until the requester allows it. label Aug 14, 2020
Copy link
Copy Markdown
Contributor

@kohidave kohidave left a comment

Choose a reason for hiding this comment

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

Thank you! <3 <3 <3

Comment on lines +52 to +62
It("deploy vpc cloudformation stack", func() {
err := command.Run("aws", []string{"cloudformation", "create-stack", "--stack-name",
vpcStackName, "--template-body", vpcStackTemplatePath})
Expect(err).NotTo(HaveOccurred(), "create vpc cloudformation stack")
err = command.Run("aws", []string{"cloudformation", "wait", "stack-create-complete", "--stack-name", vpcStackName})
Expect(err).NotTo(HaveOccurred(), "vpc stack create complete")
})
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we throw this into a BeforeAll?

Comment on lines +60 to +66
var b bytes.Buffer
err := command.Run("bash", []string{"-c", fmt.Sprintf("aws cloudformation describe-stacks --stack-name %s | jq -r .Stacks[0].Outputs", vpcStackName)}, command.Stdout(&b))
Expect(err).NotTo(HaveOccurred(), "describe vpc cloudformation stack")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe we can throw this into a aws.go file? (Like how we have the CLI one). The Output can be a VPC object or whatever - that way the tests stay really focused on the expected output.

})
})

It("svc deploy should succeed to both environment", func() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
It("svc deploy should succeed to both environment", func() {
It("svc deploy should succeed to both environments", func() {

Comment thread e2e/customized-env/customized_env_suite_test.go
}
})

It("env show should display info for test and prod envs", func() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Dumb question: Do we we care about any of the service workflows in this e2e test?

I wonder if instead we should have only this It and include --resources to the command to validate if the environment is created with the appropriate resource configurations?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

hmm i think it doesn't hurt to validate show and logs to make sure the svc we deploy is actually working as expected. But I'll add validation for --resources!

@iamhopaul123 iamhopaul123 force-pushed the e2e/customized-env-resources branch from 64f51d8 to 926a9b0 Compare August 18, 2020 19:46
@iamhopaul123 iamhopaul123 added the do-not-merge Pull requests that mergify shouldn't merge until the requester allows it. label Aug 18, 2020
@iamhopaul123 iamhopaul123 removed the do-not-merge Pull requests that mergify shouldn't merge until the requester allows it. label Aug 18, 2020
@mergify mergify bot merged commit b57b233 into aws:mainline Aug 18, 2020
mergify bot pushed a commit that referenced this pull request Aug 19, 2020
<!-- Provide summary of changes -->
Move bash commands in e2e tests to `client` pkg so as to make e2e tests more declarative. Address #1264 (comment).
<!-- Issue number, if available. E.g. "Fixes #31", "Addresses #42, 77" -->

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
thrau pushed a commit to localstack/copilot-cli-local that referenced this pull request Dec 9, 2022
This PR adds e2e test for customized env resources.

<!-- Provide summary of changes -->

<!-- Issue number, if available. E.g. "Fixes aws#31", "Addresses aws#42, 77" -->

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
thrau pushed a commit to localstack/copilot-cli-local that referenced this pull request Dec 9, 2022
<!-- Provide summary of changes -->
Move bash commands in e2e tests to `client` pkg so as to make e2e tests more declarative. Address aws#1264 (comment).
<!-- Issue number, if available. E.g. "Fixes aws#31", "Addresses aws#42, 77" -->

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
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.

4 participants