-
Notifications
You must be signed in to change notification settings - Fork 437
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
Refactor Kubernetes E2E test definition for ease of use #9581
Conversation
Visit the preview URL for this PR (updated for commit 3d86031): https://gloo-edge--pr9581-jbohanon-e2e-tests-c-f5lfdmel.web.app (expires Thu, 20 Jun 2024 14:45:20 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 77c2b86e287749579b7ff9cadb81e099042ef677 |
…/gloo into jbohanon/e2e-tests-cleanup
Issues linked to changelog: |
/skip-ci Kube tests only |
test/kubernetes/e2e/tests/automtls_istio_edge_api_tests_to_run.go
Outdated
Show resolved
Hide resolved
test/kubernetes/e2e/tests/automtls_istio_edge_api_tests_to_run.go
Outdated
Show resolved
Hide resolved
…/gloo into jbohanon/e2e-tests-cleanup
…/gloo into jbohanon/e2e-tests-cleanup
/skip-ci Kube tests only |
…/gloo into jbohanon/e2e-tests-cleanup
Had to kick cluster one due to this error which looks like the validation flakiness being worked on elsewhere in this repo now
|
/skip-ci Kube tests only |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice work!
/skip-ci Kube tests only |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great work!
/skip-ci Kube tests only |
Dozer? |
* make tests runnable with injection * yoink var into better package * refactor for un/ordered, convert the rest * fix a missed merge conflict * add changelog * oops wrong skip * rename and refactor * clean up and compiler-assert new suite signatures * documentation * documentation * fix my runs * wrap un/ordered in struct for ease of use * Adding changelog file to new location * Deleting changelog file from old location * move changelog * Update test/kubernetes/e2e/tests/glooctl_istio_inject_tests.go * refactor to export less * move and rename suite runner * update readme * rename some more stuff --------- Co-authored-by: soloio-bulldozer[bot] <48420018+soloio-bulldozer[bot]@users.noreply.github.com> Co-authored-by: changelog-bot <changelog-bot>
* make tests runnable with injection * yoink var into better package * refactor for un/ordered, convert the rest * fix a missed merge conflict * add changelog * oops wrong skip * rename and refactor * clean up and compiler-assert new suite signatures * documentation * documentation * fix my runs * wrap un/ordered in struct for ease of use * Adding changelog file to new location * Deleting changelog file from old location * move changelog * Update test/kubernetes/e2e/tests/glooctl_istio_inject_tests.go * refactor to export less * move and rename suite runner * update readme * rename some more stuff --------- Co-authored-by: Jacob Bohanon <jacob.bohanon@solo.io> Co-authored-by: soloio-bulldozer[bot] <48420018+soloio-bulldozer[bot]@users.noreply.github.com>
Description
Introduces abstractions over the test cases for Ordered and Unordered sets of tests within a suite. This allows us to define the run behavior of the tests separate from the suite that runs them.
Also refactors the tests out into an importable
tests
package (*_test
packages cannot be imported). This will allow us to run the tests in the same way in EE, and also make sure the test suites in OSS and EE stay in lockstep.Any tests which did not have a comment about needing to be ordered were assumed to be unordered. There is a non-zero risk that this introduces some flakes if the test order was in fact important.
Context
Tests added to these suites in OSS had to be added in the same manner in EE. By exporting the entire pack of tests to run, the EE suites can import them to run on their bespoke
e2e.TestInstallation
.Code changes
*_test
package and it seemed cleaner to me (and possibly necessary for testify but not sure) to leave the suites in*_test
package.Testing steps
I manually verified behavior by opening https://github.com/solo-io/solo-projects/pull/6314 and running nightlies off of that branch to see that the expected suite ran (at that time just the k8s_gw_tests had been migrated).
Interesting decisions
In order to reduce verbosity of defining a new test, we strip back some of the injection to the actual
Run
function. This means that we cannot need to reference the three things we need injected (ctx, t, testInstallation
) when we are registering tests. To reconcile with this, what is registered is actually the feature suite construction function. We have enforced this by defining a new typedef for that signature and making a compiler assertion at the top of each feature suite for its construction function.A side-effect of this is that nested test structures such as used for Glooctl in
k8s_gw_test.go
no longer work since we don't have access to the injected values at registration time. To resolve this, nested test structures must be defined as suites. An example of this can be found in the same Glooctl test, now located ink8s_gw_tests.go
.Checklist: