Add E2E test for "kn source binding" commands#634
Add E2E test for "kn source binding" commands#634knative-prow-robot merged 1 commit intoknative:masterfrom
Conversation
|
Hi @MIBc. Thanks for your PR. I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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/test-infra repository. |
|
/ok-to-test |
| @@ -0,0 +1,73 @@ | |||
| // Copyright 2019 The Knative Authors | |||
There was a problem hiding this comment.
| // Copyright 2019 The Knative Authors | |
| // Copyright 2020 The Knative Authors |
navidshaikh
left a comment
There was a problem hiding this comment.
/lgtm
/approve
/assign @rhuss
/hold
| test.sourceBindingUpdate(t, "my-binding1", "Deployment:apps/v1:myapp", "svc:testsvc1") | ||
| out, err := test.kn.RunWithOpts([]string{"source", "binding", "describe", "my-binding1"}, runOpts{NoNamespace: false}) | ||
| assert.NilError(t, err) | ||
| assert.Check(t, strings.Contains(out, "testsvc1")) |
There was a problem hiding this comment.
I wonder whether we have the option to check whether there has been actually a server-side SinkBinding CO has been created. The test looks good, but tbh the value is not much more than within the unit test which checks the actual output on the console for the command, too.
IMO any E2E test should verify, ideally with other channels than with kn itself, whether the operation has been successfully performed.
So my preference for verifying a test would be:
- As the CO be created/updated with the content expected ?
- Or: If this is not possible or to difficult, then use e.g
kn binding describeto check for it. E.g. one coudl do akn binding describe my-binding1 -o json, parse the output an verify its content. This would at least give some enhanced certainty that the object has been created/update properly.
@MIBc do you think you could switch to kn binding describe -o json here ?
There was a problem hiding this comment.
kn source binding describe does not support -o.
How about kubectl get sinkbindings.sources.knative.dev my-binding -ojsonpath="{.spec.sink.ref.name}"
I find the getResourceFieldsWithJSONPath can do this.
Fixes knative#631 * Add E2E test for "kn source binding" commands. * Fix typo.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: maximilien, MIBc, navidshaikh, rhuss The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/retest |
1 similar comment
|
/retest |
Fixes #631
Proposed Changes
Release Note:
Add E2E test for "kn source binding" commands.