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

Terratest e2e test #93

Merged
merged 8 commits into from
Oct 7, 2021
Merged

Terratest e2e test #93

merged 8 commits into from
Oct 7, 2021

Conversation

RothAndrew
Copy link
Contributor

@RothAndrew RothAndrew commented Oct 6, 2021

This is rough, but it works. I want to get it looked at and merged before it gets any bigger.

Primary changes

  • Add a Terratest-based E2E test in the new directory /test. It consists of a reusable Terraform module that creates an EC2 instance and a small golang project that is separate from the golang project in the /cli directory. Run the test with aws-vault exec your-profile-here -- make test-e2e

Secondary changes

  • (:warning: potentially breaking if there is any automation that depends on these make targets) Rename the test and test-close Makefile targets to vm-init and vm-destroy
  • Add Makefile target help: Lists all targets
  • Add Makefile target test-e2e: Run the new Terratest-based E2E test
  • Add Makefile target e2e-ssh: For test development, lets you ssh into the EC2 instance that was running the E2E test for debugging

To-Do

There's a lot to do here still. The way I want this to be looked at is as an MVP that sets up the framework.

  • New docs
  • terraform_ssh_e2e_test.go is really big, but 95% of it will look identical for every E2E test we make, so we should extract all the boilerplate into a different file (maybe something like test_harness.go)
  • I promised to make any E2E tests runnable locally as well with minimal setup. That's not done yet.
  • Need to obviously add more E2E tests
  • Need to either use directly or ensure everything that e2e.sh does the new E2E tests do
  • Need to incorporate the tests into the automated CI pipeline by setting up the /test e2e chatops trigger (see pipeline #81)
  • Need to generally just cleanup and refactor a bunch of it to be more performant. Right now it's clunky and slow and can definitely be improved.

@RothAndrew RothAndrew requested a review from jeff-mccoy October 6, 2021 23:08
@RothAndrew RothAndrew marked this pull request as ready for review October 6, 2021 23:13
@jeff-mccoy jeff-mccoy enabled auto-merge (squash) October 7, 2021 05:32
@jeff-mccoy jeff-mccoy merged commit efd6454 into master Oct 7, 2021
@jeff-mccoy jeff-mccoy deleted the feature/new-parallel-e2e-tests branch October 7, 2021 05:33
jeff-mccoy pushed a commit that referenced this pull request Feb 8, 2022
Introduce go-based E2E testing

Signed-off-by: Jeff McCoy <[email protected]>
Noxsios pushed a commit that referenced this pull request Mar 8, 2023
Introduce go-based E2E testing

Signed-off-by: Jeff McCoy <[email protected]>
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