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

Consolidate test data #2716

Merged
merged 1 commit into from
Apr 13, 2023
Merged

Conversation

carolynvs
Copy link
Member

@carolynvs carolynvs commented Apr 10, 2023

What does this change

We have a LOT of test bundles that are all slightly different which makes for a lot of test maintenance. I've updated the test bundles so that they are reused more across our unit tests, and removed unnecessary test bundles. Whenever possible let's use the test bundles in tests/testdata so that we aren't constantly testing against minor variations of the hello world bundle everywhere.

  • tests/testdata/mybuns - Has as many test cases as we can reasonably stuff into a single bundle. It doesn't make sense but helps us validate and regression test a bunch of stuff at once. This is the default bundle that we should try to use instead of making variations of hello world.
  • tests/testdata/mydb - a dependency of mybuns, regression test for v1 of dependencies but shouldn't be used otherwise.
  • tests/testdata/myenv - A meta bundle for testing dependendencies v2. It relies on myapp, myinfra and mysqldb bundles which are all part of essentially the same test case, a complex bundle graph. I'd avoid using this for testing anything but dependencies v2 since running it will involve running up to 4 bundles, which will be slower than mybuns.

What issue does it fix

N/A

Notes for the reviewer

None

Checklist

  • Did you write tests?
  • Did you write documentation?
  • Did you change porter.yaml or a storage document record? Update the corresponding schema file.
  • If this is your first pull request, please add your name to the bottom of our Contributors list. Thank you for making Porter better! 🙇‍♀️

Reviewer Checklist

  • Comment with /azp run test-porter-release if a magefile or build script was modified
  • Comment with /azp run porter-integration if it's a non-trivial PR

We have a LOT of test bundles that are all slightly different which makes for a lot of test maintenance. I've updated the test bundles so that they are reused more across our unit tests, and removed unnecessary test bundles. Whenever possible let's use the test bundles in tests/testdata so that we aren't constantly testing against minor variations of the hello world bundle everywhere.

* tests/testdata/mybuns - Has as many test cases as we can reasonably stuff into a single bundle. It doesn't make sense but helps us validate and regression test a bunch of stuff at once. This is the default bundle that we should try to use instead of making variations of hello world.
* tests/testdata/mydb - a dependency of mybuns, regression test for v1 of dependencies but shouldn't be used otherwise.
* tests/testdata/myenv - A meta bundle for testing dependendencies v2. It relies on myapp, myinfra and mysqldb bundles which are all part of essentially the same test case, a complex bundle graph. I'd avoid using this for testing anything but dependencies v2 since running it will involve running up to 4 bundles, which will be slower than mybuns.

Signed-off-by: Carolyn Van Slyck <[email protected]>
@carolynvs carolynvs marked this pull request as ready for review April 13, 2023 19:07
Copy link
Contributor

@sgettys sgettys left a comment

Choose a reason for hiding this comment

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

Nice cleanup! This makes it much cleaner

@carolynvs
Copy link
Member Author

We definitely have some more candidates to remove, let's keep an eye out when working with tests that hit a variation of the "porter-hello" bundle and update it to use a bundle from tests/testdata. 👍

@carolynvs carolynvs merged commit 81b6d4f into getporter:main Apr 13, 2023
@carolynvs carolynvs deleted the consolidate-testdata branch April 13, 2023 20:13
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.

None yet

2 participants