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

[sync] Improve e2e test configurability (#1650) #1732

Open
wants to merge 4 commits into
base: rhoai
Choose a base branch
from

Conversation

zdtsw
Copy link
Member

@zdtsw zdtsw commented Mar 12, 2025

  • Improve e2e test configurability

This feature is to improve the configurability of the e2e test suite, which is particularly useful when running the test suite locally.

There are two new flags to globally enabled/disable some test grouops such as components and services:

  • --test-components=true|false
  • --test-services=true|false

It is also possible to disable a particular test by preceding its name with an exlamation mark (!), i.e. to run only the test for the dashbaord component and skip the tests for the auth service:

make e2e-test E2E_TEST_FLAGS='--test-component=dashboard --test-service=!auth'

  • Fix validation logic

(cherry picked from commit 39da621)

Description

sync #1650

How Has This Been Tested?

Screenshot or short clip

Merge criteria

  • You have read the contributors guide.
  • Commit messages are meaningful - have a clear and concise summary and detailed explanation of what was changed and why.
  • Pull Request contains a description of the solution, a link to the JIRA issue, and to any dependent or related Pull Request.
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has manually tested the changes and verified that the changes work

@openshift-ci openshift-ci bot requested review from grdryn and ugiordan March 12, 2025 07:45
@zdtsw zdtsw requested review from lburgazzoli and removed request for grdryn and ugiordan March 12, 2025 07:45
Copy link

openshift-ci bot commented Mar 12, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lburgazzoli, ugiordan

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 [lburgazzoli,ugiordan]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

}

func createDeletionConfigMap(tc *testContext, enableDeletion string) error {
configMap := &corev1.ConfigMap{
ObjectMeta: metav1.ObjectMeta{
Name: deleteConfigMap,
Namespace: tc.operatorNamespace,
Namespace: testOpts.operatorNamespace,
Copy link
Member

Choose a reason for hiding this comment

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

If we use testOpts directly inside a test without passing it through the context, it can cause an initialization cycle issue. This becomes problematic if you want to debug a specific component test without running the entire test suite.

For example, if I place this test inside TestOdhOperator for debugging it

t.Run("kueueTestSuite", kueueTestSuite)

I'll get the following issue:

# github.com/opendatahub-io/opendatahub-operator/v2/tests/e2e_test [github.com/opendatahub-io/opendatahub-operator/v2/tests/e2e.test]
./controller_test.go:42:2: initialization cycle for testOpts
	./controller_test.go:42:2: testOpts refers to
	./modelmeshserving_test.go:23:6: modelMeshServingTestSuite refers to
	./components_test.go:68:29: ValidateComponentEnabled refers to
	./controller_test.go:42:2: testOpts

@lburgazzoli
Copy link
Member

/test opendatahub-operator-e2e

1 similar comment
@lburgazzoli
Copy link
Member

/test opendatahub-operator-e2e

@lburgazzoli
Copy link
Member

/retest

@openshift-ci openshift-ci bot removed the lgtm label Mar 13, 2025
Copy link

openshift-ci bot commented Mar 13, 2025

New changes are detected. LGTM label has been removed.

@zdtsw
Copy link
Member Author

zdtsw commented Mar 14, 2025

/test opendatahub-operator-e2e

@zdtsw
Copy link
Member Author

zdtsw commented Mar 15, 2025

/test opendatahub-operator-e2e

@zdtsw zdtsw mentioned this pull request Mar 17, 2025
5 tasks
@zdtsw
Copy link
Member Author

zdtsw commented Mar 17, 2025

/test opendatahub-operator-e2e

1 similar comment
@zdtsw
Copy link
Member Author

zdtsw commented Mar 18, 2025

/test opendatahub-operator-e2e

@zdtsw
Copy link
Member Author

zdtsw commented Mar 18, 2025

i cannot think of any reason after my last commits try to fix the test on RHOAI, it still failed with
expected odh-admins, found rhods-admins
the reason it falls into this case is
tc get release as ODH or Unknown and the value set in Auth is correct.

@lburgazzoli
Copy link
Member

/test all

1 similar comment
@lburgazzoli
Copy link
Member

/test all

lburgazzoli and others added 4 commits March 24, 2025 17:57
* Improve e2e test configurability

This feature is to improve the configurability of the e2e test suite,
which is particularly useful when running the test suite locally.

There are two new flags to globally enabled/disable some test grouops
such as components and services:

* --test-components=true|false
* --test-services=true|false

It is also possible to disable a particular test by preceding its name
with an exlamation mark (!), i.e. to run only the test for the dashbaord
component and skip the tests for the auth service:

  make e2e-test E2E_TEST_FLAGS='--test-component=dashboard --test-service=!auth'

* Fix validation logic

(cherry picked from commit 39da621)
* fix auth tests for RHOAI

* fix lint

---------

Co-authored-by: Steven Tobin <[email protected]>
(cherry picked from commit e8e430c)
Signed-off-by: Wen Zhou <[email protected]>
- ODH it falls to Unknonw but in RHOAI it fails test with "" string

Signed-off-by: Wen Zhou <[email protected]>
- getPlatform can properly work
- otherwise, in RHOAI e2e, it return Unknown nil by detectManagedRhoai

Signed-off-by: Wen Zhou <[email protected]>
Copy link

openshift-ci bot commented Mar 24, 2025

@zdtsw: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/opendatahub-operator-e2e 711b5f7 link true /test opendatahub-operator-e2e

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

5 participants