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

test: Refactor Terraform Build Tests #6013

Merged
merged 23 commits into from
Oct 3, 2023

Conversation

mildaniel
Copy link
Contributor

Which issue(s) does this change fix?

N/A

Why is this change necessary?

Currently, the Terraform-related build tests continuously re-build the same function code using the same build method for 30+ functions in several different test classes. This is redundant and takes a long time to execute without providing much additional validation. Currently, 5 workers are required to run these tests on AppVeyor with the longest test class taking over an hour.

This PR reworks the way these tests are executed in a way that requires a single runner with all tests being completed in < 1 hour.

How does it address the issue?

Instead the new testing flow is:

  1. Build a single function. This will produce the metadata file for all functions but will only run the build method once per test class.
  2. Validate that the resources produced in the metadata file are correct by comparing against an expected template.yaml file.
  3. Test local invoke against the single built function instead of all functions (the function code is the same for them all anyways, no point in invoking them all).

Mandatory Checklist

PRs will only be reviewed after checklist is complete

  • Add input/output type hints to new functions/methods
  • Write design document if needed (Do I need to write a design document?)
  • Write/update unit tests
  • Write/update integration tests
  • Write/update functional tests if needed
  • make pr passes
  • make update-reproducible-reqs if dependencies were changed
  • Write documentation

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

@mildaniel mildaniel requested a review from a team as a code owner September 29, 2023 21:09
@mildaniel mildaniel requested a review from mndeveci October 3, 2023 17:42
@mildaniel mildaniel enabled auto-merge October 3, 2023 17:54
@mildaniel mildaniel added this pull request to the merge queue Oct 3, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Oct 3, 2023
@mildaniel mildaniel added this pull request to the merge queue Oct 3, 2023
Merged via the queue into aws:develop with commit 0689160 Oct 3, 2023
76 checks passed
@mildaniel mildaniel deleted the update-terraform-testing-procedure branch October 4, 2023 12:12
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