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

Refactor serial tests into their own package #290

Merged

Conversation

rhmdnd
Copy link

@rhmdnd rhmdnd commented Apr 12, 2023

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.

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.
@rhmdnd rhmdnd changed the title Setup serial test package and port TestScanStorageOutOfQuotaRangeFails Refactor serial tests into their own package Apr 13, 2023

.PHONY: e2e
e2e-test-wait:
./utils/e2e-test-wait.sh
Copy link
Author

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
Copy link
Author

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"
)

Copy link
Author

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 {
Copy link
Author

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.
Copy link
Author

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.
Copy link
Collaborator

@JAORMX JAORMX left a 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!

@openshift-ci
Copy link

openshift-ci bot commented Apr 14, 2023

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

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.

4 participants