-
Notifications
You must be signed in to change notification settings - Fork 24
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 serial tests into their own package #290
Refactor serial tests into their own package #290
Conversation
This commit starts refactoring the serial tests to follow the same pattern as the parallel tests, where we have a dedicated package for serial tests. This allows us to simpliy test setup and ultimately remove the custom test runner.
110508e
to
c28b09b
Compare
|
||
.PHONY: e2e | ||
e2e-test-wait: | ||
./utils/e2e-test-wait.sh |
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.
Note for reviewers - this is necessary so that the parallel test environment has time to cleanup CRDs before the serial tests spin up a new deployment for testing. Without this the serial tests will fail because some of the CRDs are still lingering.
@@ -1,19 +0,0 @@ | |||
package e2e |
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.
These constants were moved to the framework package so they can be shared across parallel and serial tests.
"k8s.io/client-go/kubernetes" | ||
"sigs.k8s.io/controller-runtime/pkg/client" | ||
) | ||
|
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.
These utilities were moved to the framework package.
return nil | ||
} | ||
|
||
func (f *Framework) AssertRemediationIsObsolete(namespace, name string) error { |
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.
I'd like to split the assertions into a separate file in a follow on patch so that we can make this module a little smaller (e.g., framework/common.go
for utilities and framework/assertions.go
for assertions).
@@ -575,16 +575,19 @@ test-benchmark: ## Run the benchmark tests -- Note that this can only be ran for | |||
@echo "The pprof files generated are: cpu.prof and mem.prof" | |||
|
|||
.PHONY: e2e | |||
e2e: e2e-set-image prep-e2e ## Run full end-to-end tests that exercise content on an operational cluster. | |||
@CONTENT_IMAGE=$(E2E_CONTENT_IMAGE_PATH) BROKEN_CONTENT_IMAGE=$(E2E_BROKEN_CONTENT_IMAGE_PATH) $(GO) test ./tests/e2e $(E2E_GO_TEST_FLAGS) -args $(E2E_ARGS) | tee tests/e2e-test.log | |||
e2e: e2e-set-image prep-e2e e2e-parallel e2e-test-wait e2e-serial ## Run full end-to-end tests that exercise content on an operational cluster. |
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.
This target still isn't used by CI since it invokes the parallel and serial tests separately, but it's around in case people are using it locally for a complete e2e run.
This commit also removes dead code as a result of refactoring the serial tests into their own package and not needing a separate test runner.
c28b09b
to
e629fd5
Compare
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.
I really like this approach and I love that there is even more deleted code than added. Great refactoring!
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: JAORMX, rhmdnd The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This commit starts refactoring the serial tests to follow the same
pattern as the parallel tests, where we have a dedicated package for
serial tests.
This allows us to simpliy test setup and ultimately remove the custom
test runner.