test: Add test cases for discovery.go#81
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.
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. |
❌ PR Title Verification FailedYour PR title does not follow the required format. Current title: Required FormatPR titles must start with one of these emoji prefixes:
How to FixEdit your PR title to start with the appropriate emoji. For example:
You can edit the title by clicking the Edit button next to your PR title. This comment was posted to help you fix the PR title format. |
Description
This PR adds test cases for discovery.go.