-
Notifications
You must be signed in to change notification settings - Fork 105
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
CNF-16063: E2E: Add hypershift support to container runtime config tests #1229
CNF-16063: E2E: Add hypershift support to container runtime config tests #1229
Conversation
Skipping CI for Draft Pull Request. |
2174fae
to
d60c1fe
Compare
/retest |
test/e2e/performanceprofile/functests/utils/nodepools/nodepools.go
Outdated
Show resolved
Hide resolved
d60c1fe
to
5d7fe67
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.
Thank you for this work Sargun!
I realize that my removal of the container runtime type in this switch case has impacted the e2e, and it resulted with creating manually configmaps for ctrcfg.
Since we are no longer want to interact with ctrcfg from the controller perspective my deletion was correct. However, since we use the func GetObjectConfigMapDataKey
for testing purposes aswell we might want to retain that line.
@Tal-or WDYT?
test/e2e/performanceprofile/functests/2_performance_update/updating_profile.go
Outdated
Show resolved
Hide resolved
test/e2e/performanceprofile/functests/2_performance_update/updating_profile.go
Outdated
Show resolved
Hide resolved
test/e2e/performanceprofile/functests/2_performance_update/updating_profile.go
Outdated
Show resolved
Hide resolved
test/e2e/performanceprofile/functests/2_performance_update/updating_profile.go
Outdated
Show resolved
Hide resolved
test/e2e/performanceprofile/functests/2_performance_update/updating_profile.go
Outdated
Show resolved
Hide resolved
test/e2e/performanceprofile/functests/2_performance_update/updating_profile.go
Outdated
Show resolved
Hide resolved
test/e2e/performanceprofile/functests/2_performance_update/updating_profile.go
Outdated
Show resolved
Hide resolved
test/e2e/performanceprofile/functests/2_performance_update/updating_profile.go
Outdated
Show resolved
Hide resolved
test/e2e/performanceprofile/functests/2_performance_update/updating_profile.go
Outdated
Show resolved
Hide resolved
/test e2e-pao-updating-profile-hypershift Let's not forget to test the work here |
/retest-required The e2e-gcp-pao-updating-profile has reached the 5h timeout, we should consider to extend the time. |
5d7fe67
to
8fc68f5
Compare
/test e2e-pao-updating-profile-hypershift |
/retest |
8fc68f5
to
9e7da4d
Compare
/test e2e-pao-updating-profile-hypershift |
/retest |
@@ -442,7 +444,7 @@ var _ = Describe("[rfe_id:28761][performance] Updating parameters in performance | |||
|
|||
By("Creating new MachineConfigPool") | |||
mcp = mcps.New(newRole, newNodeSelector) | |||
err = testclient.ControlPlaneClient.Create(context.TODO(), mcp) | |||
err = testclient.Client.Create(context.TODO(), mcp) |
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.
We should not use bare Client
anymore. Is there a reason for this change?
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.
In the context of "Updating the nodeSelector
parameter and node labels," there are still several instances using Client
. Previously, I updated some occurrences with the appropriate client, but @rbaturov advised that we should handle the cleanup in a separate PR, as this PR is focused specifically on containerRuntimeConfig tests.
ctrcfg, err = getContainerRuntimeConfigFrom(context.TODO(), profile, mcp) | ||
Expect(err).ToNot(HaveOccurred(), "failed to get ContainerRuntimeConfig from profile %q mcp %q", profile.Name, mcp.Name) | ||
if ctrcfg != nil { | ||
Skip(fmt.Sprintf("ContainerRuntimeConfig %s exist in the cluster and not expected", ctrcfg.Name)) |
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.
Why these checks are needed?
The tests are suppose to be running under our CI, and noone but the test is suppose to pollute the cluster state and create undesired ContainerRuntimeConfig
object.
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.
@Tal-or Well this check was from the original test before even my refactor.
If we plan to use this e2e solely on CI and therefore no ctrcfg is expected, then I guess it is safe to remove this.
However, if this test is somehow executed on a cluster with container runtime config it might run into trouble since it is not designed to start this way. I would not remove this check.
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.
Our tests are intended to run on clean, persisted and consistent environment.
As I suggested to @SargunNarula we should not skip but log with error because having unexpected objects on the cluster, might hide even a bigger problem.
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.
Logging an error and running this test could potentially fail or not test the desired functionality. IOW, this test is incorrect if it runs on a system with ctrcfg pre-installed.
I think the best way to go forward here to ensure we do not have "unexpected objects on the cluster, might hide even a bigger problem." is to fail the test right away if a ctrcfg is found with a proper message
By(fmt.Sprintf("creating ContainerRuntimeConfig %q", ctrcfg.Name)) | ||
Expect(testclient.Client.Create(context.TODO(), ctrcfg)).ToNot(HaveOccurred(), "failed to create ctrcfg %#v", ctrcfg) | ||
if hypershift.IsHypershiftCluster() { | ||
ctrcfg_configmap, err = containerRuntimeConfigConfigMap(ContainerRuntimeConfigName, profile, mcp) |
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.
You don't need that.
You're already get the for free by in the Client.Create
call
Line 65 in 8aa2a81
func (ci *ControlPlaneClientImpl) Create(ctx context.Context, obj client.Object, opts ...client.CreateOption) 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.
If we're still testing the affect of |
Let's do that. @SargunNarula just add this line that I removed back again |
Alright, I will include that revert change in this PR itself. |
Signed-off-by: Sargun Narula <[email protected]> Revert: ContainerRuntimeConfig handling for test purposes This reverts the removal of ContainerRuntimeConfig handling in the switch case, which inadvertently impacted e2e tests. While the deletion was correct from the controller's perspective (as we no longer had to interact with ContainerRuntimeConfig), the function `GetObjectConfigMapDataKey` is still used for testing purposes. To ensure e2e tests function correctly and to continue testing the effects of ContainerRuntimeConfig, this change is being reverted. Signed-off-by: Sargun Narula <[email protected]>
9e7da4d
to
961e5b8
Compare
/test e2e-pao-updating-profile-hypershift Lets not forget this test |
/retest |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: MarSik, SargunNarula 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 |
@SargunNarula: This pull request references CNF-16063 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.19.0" version, but no target version was set. In response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
/refresh |
@SargunNarula: The following test failed, say
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. |
61c94c4
into
openshift:master
[ART PR BUILD NOTIFIER] Distgit: cluster-node-tuning-operator |
The container runtime configuration test was omitted during the HyperShift adjustments, as it was initially deemed unsuitable for HyperShift. This change introduces support for it.