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

📝 Parallelize the Config Policy controller E2E tests #145

Conversation

yiraeChristineKim
Copy link
Contributor

The Config Policy controller's E2E tests in its repo takes roughly 45 minutes to run. This is due to all the test running serially. These could be optimized to run in parallel for faster execution.

Acceptance Criteria:

The config-policy-controller E2E tests run in under 20 minutes or Christine declares it impossible.

Copy link
Member

@JustinKuli JustinKuli left a comment

Choose a reason for hiding this comment

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

Looks good overall! Just a few small questions. I'd also prefer to see a more descriptive commit message.

Makefile Outdated
Comment on lines 208 to 209
$(GINKGO) -v -p --fail-fast -procs=7 $(E2E_TEST_ARGS) test/e2e
#
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to specify -procs here? From the docs, it sounds like it would pick an "ideal" number based on the machine it's running on. Since this same target will run in both the github action run and locally, I feel like it could be better to let it choose.

Also, is there an accidental empty comment here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

cuz our CI default is 2

Copy link
Contributor Author

@yiraeChristineKim yiraeChristineKim Jun 22, 2023

Choose a reason for hiding this comment

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

I wonder limitation looks more procs faster also I didn't request a review because I am not finished yet so weird.. I cannot even remove you from the reviewer list. you are the default reviewer now

Copy link
Member

Choose a reason for hiding this comment

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

I wonder limitation looks more procs faster also I didn't request a review because I am not finished yet so weird.. I cannot even remove you from the reviewer list. you are the default reviewer now

FYI for next time, if you open a Draft PR, it doesn't get assigned reviewers but I think workflows still run. 🙂

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh!! Draft PR I will ask you next time Thanks for letting know good info!!! @dhaiducek

@@ -11,7 +11,7 @@ spec:
- complianceType: musthave
objectDefinition:
apiVersion: v1
kind: ConfigMap
kind: case28-ConfigMap
Copy link
Member

Choose a reason for hiding this comment

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

What is this change for? It seems like the test just needs any policy (it doesn't care if it's compliant or not) but this seems odd.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch!!

@@ -24,8 +24,8 @@ const (
tlsProfileInformYaml string = "../resources/case11_apiserver_config/tls_profile_inform.yaml"
)

var _ = Describe("Test APIServer Config policy", func() {
Describe("Test etcd encryption and tls profile", func() {
var _ = Describe("Test APIServer Config policy", Serial, func() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This test is removing API so affect others

Makefile Outdated
@@ -205,7 +205,7 @@ install-resources:

.PHONY: e2e-test
e2e-test: e2e-dependencies
$(GINKGO) -v --fail-fast $(E2E_TEST_ARGS) test/e2e
$(GINKGO) -v -p -procs=7 --fail-fast $(E2E_TEST_ARGS) test/e2e
Copy link
Contributor Author

Choose a reason for hiding this comment

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

CI default is 2 so I had to do this

deleteConfigPolicies([]string{case13Unterminated, case13WrongArgs})
})
})
// Though the Bugzilla bug #2007575 references a different incorrect behavior, it's the same
// underlying bug and this behavior is easier to test.
Describe("RHBZ#2007575: Test that the template updates when a referenced resource object is updated", func() {
const configMapName = "configmap-update-referenced-object"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just added Describe around describe

Copy link
Member

@dhaiducek dhaiducek left a comment

Choose a reason for hiding this comment

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

Thanks! This is going to be so great to not have to wait an hour for the E2E tests! I have some comments/questions.

.github/workflows/kind.yml Outdated Show resolved Hide resolved
test/e2e/case13_templatization_test.go Show resolved Hide resolved
test/e2e/case13_templatization_test.go Show resolved Hide resolved
test/e2e/case13_templatization_test.go Outdated Show resolved Hide resolved
test/e2e/case6_no_ns_test.go Show resolved Hide resolved
test/e2e/case6_no_ns_test.go Show resolved Hide resolved
test/e2e/case25_related_object_metric_test.go Outdated Show resolved Hide resolved
test/utils/utils.go Outdated Show resolved Hide resolved
Copy link
Member

@mprahl mprahl left a comment

Choose a reason for hiding this comment

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

Just one minor comment but otherwise, this looks great to me! Nice job.

@mprahl
Copy link
Member

mprahl commented Jun 28, 2023

@yiraeChristineKim could you please squash the commits?

Signed-off-by: Yi Rae Kim <yikim@redhat.com>
@openshift-ci
Copy link

openshift-ci bot commented Jun 28, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mprahl, yiraeChristineKim

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:
  • OWNERS [mprahl,yiraeChristineKim]

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.

5 participants