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

add daemonset e2e test #366

Merged
merged 1 commit into from
Jan 13, 2025
Merged

add daemonset e2e test #366

merged 1 commit into from
Jan 13, 2025

Conversation

asm582
Copy link
Contributor

@asm582 asm582 commented Jan 10, 2025

Add ginkgo-based daemonset test cases.

make test, make lint and make test-emulated-gpu and gpu test on kind cluster pass.

@openshift-ci openshift-ci bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jan 10, 2025
@openshift-ci openshift-ci bot requested review from cpmeadors and mamy-CS January 10, 2025 21:42
Copy link

openshift-ci bot commented Jan 10, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: asm582

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 10, 2025
@asm582 asm582 requested review from sairameshv and harche January 10, 2025 21:44
@asm582
Copy link
Contributor Author

asm582 commented Jan 10, 2025

/hold for testing on OCP

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 10, 2025
@@ -631,6 +631,119 @@ var _ = Describe("controller", Ordered, func() {
fmt.Sprintf("%s on node does not match total GPU memory in Instaslice object", controller.QuotaResourceName))
}
})
Copy link
Member

Choose a reason for hiding this comment

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

I think you missed the step of Generating fake instaslice object only in case of emulated mode set to true
https://github.com/openshift/instaslice-operator/pull/361/files#diff-d5d12b6ea07b0a78c9ad1987e1486c565ecf16839f77a93e91b09475cf6c0e99R153-R159

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 do it in BeforeEach, will that not work?

Copy link
Member

Choose a reason for hiding this comment

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

Thanks, I missed that. I thought you were making the change as part of the earlier PR which is closed and missed it here

}
err := k8sClient.List(ctx, instasliceObjs, &client.ListOptions{Namespace: namespace})
Expect(err).NotTo(HaveOccurred(), "Failed to retrieve Instaslice object")
referenceLen := len(instasliceObjs.Items[0].Spec.MigGPUUUID)
Copy link
Member

Choose a reason for hiding this comment

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

Better to add a condition to check the length of the obtained Instaslice object list and then proceed with accessing the Items

Copy link
Contributor Author

@asm582 asm582 Jan 12, 2025

Choose a reason for hiding this comment

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

valid InstaSlice object should always exist, per the BeforeEach contract; I am not sure what we buy with len check.

Copy link
Member

Choose a reason for hiding this comment

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

I totally agree that the respective objects are present in our testcases. I suggested this change as per the coding guidance/style to avoid unnecessary panics for ex: (may be) lets say we delete instaslice in a new testcase to test how the system works without it. It may not be a big deal/blocking change and the rest looks good to me. Please unhold if you feel the same and keep the code as is.

/lgtm
/hold

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jan 13, 2025
@asm582
Copy link
Contributor Author

asm582 commented Jan 13, 2025

/hold cancel

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 13, 2025
Copy link

openshift-ci bot commented Jan 13, 2025

@asm582: all tests passed!

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.

@openshift-merge-bot openshift-merge-bot bot merged commit 3a8f3a9 into openshift:main Jan 13, 2025
5 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants