-
Notifications
You must be signed in to change notification settings - Fork 17
test: Add test cases for discovery.go #81
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
base: main
Are you sure you want to change the base?
Conversation
|
@Rupam-It I got one error here for TestBuildClusterClient. It seems like doesn't returns override context. Reference: https://github.com/kubestellar/kubectl-plugin/blob/main/pkg/cluster/discovery.go#L136 Can't we just return |
|
@Rupam-It Any updates for this? |
Rupam-It
left a comment
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.
Hii @gaurab-khanal can you please describe what the problem with ctx?
|
@Rupam-It here I have set the current context as test-context https://github.com/kubestellar/kubectl-plugin/pull/81/files#diff-a293e138a2305a7b5edbee39b5761ae99ca0797166ba219eef41b582bbbe6fbcR49 In this test I have set the context override to wds1 https://github.com/kubestellar/kubectl-plugin/pull/81/files#diff-a293e138a2305a7b5edbee39b5761ae99ca0797166ba219eef41b582bbbe6fbcR172 but got test-context . This may be due to https://github.com/kubestellar/kubectl-plugin/blob/main/pkg/cluster/discovery.go#L136 not returning the override context. |
|
@gaurab-khanal Now I understand the problem ! Did you think any solution of this problem ? |
|
@Rupam-It Instead of returning current context via https://github.com/kubestellar/kubectl-plugin/blob/main/pkg/cluster/discovery.go#L136 |
|
I'm not sue about this ! |
|
@gaurab-khanal is the issue you were facing is fixed ? |
|
@Rupam-It here current context is returned instead of override context. https://github.com/kubestellar/kubectl-plugin/blob/main/pkg/cluster/discovery.go#L136 In test file, we have current context as test-context but here in this test case I have override the context to wds1 but the function is returning current context which is test-context. |
Description
This PR adds test cases for discovery.go.