-
Notifications
You must be signed in to change notification settings - Fork 263
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 E2E tests for trigger #645
Conversation
fc76456
to
54d1e78
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.
Looks good, but aren't you missing some tests for which you already prepared some private methods ? (like update, delete, or with error) ?
test/e2e/trigger_test.go
Outdated
assert.Check(t, util.ContainsAllIgnoreCase(out, "Trigger", name, "created", "namespace", test.kn.namespace)) | ||
} | ||
|
||
func (test *e2eTest) triggerCreateMissingSink(t *testing.T, name string, resources string, sa string, sink string) { |
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.
where is this test called ?
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 the review @rhuss. Yes, this is not completed. still working on other test cases
test/e2e/trigger_test.go
Outdated
|
||
_, err := kubectl.RunWithOpts([]string{"label", "namespace", test.kn.namespace, "knative-eventing-injection=enabled"}, runOpts{}) | ||
if err != nil { | ||
t.Fatalf("Error executing 'kubectl lable namespace %s knative-eventing-injection=enabled'. Error: %s", test.kn.namespace, err.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.
t.Fatalf("Error executing 'kubectl lable namespace %s knative-eventing-injection=enabled'. Error: %s", test.kn.namespace, err.Error()) | |
t.Fatalf("Error executing 'kubectl label namespace %s knative-eventing-injection=enabled'. Error: %s", test.kn.namespace, err.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.
Thanks, will fix it in next commit.
/retest |
@daisy-ycguo there seems to be compile errors:
|
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.
Incomplete...
test/e2e/trigger_test.go
Outdated
} | ||
|
||
return wait.PollImmediate(Interval, Timeout, func() (bool, error) { | ||
out, err := kubectl.RunWithOpts([]string{"get", "broker", "-n", test.kn.namespace, "-o=jsonpath='{.items[0].status.conditions[?(@.type==\"Ready\")].status}'"}, runOpts{}) |
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.
Please check this err
:
assert.NilError(t, err)
no point in propagating as this is a test
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.
exactly. checked in the new version.
/test pull-knative-client-integration-tests |
abd234e
to
16f1715
Compare
e113654
to
5dca113
Compare
|
1261c06
to
27996da
Compare
test/e2e/trigger_test.go
Outdated
func (test *e2eTest) triggerCreate(t *testing.T, name string, filters []string, sinksvc string) { | ||
filterStr := "" | ||
for _, v := range filters { | ||
filterStr = filterStr + "--filter " + v + " " |
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 can't concatenate the filters like this in a string as this will then considered to be a single argument (not multiple ones as you would expect). See also the error in the integration test.
Instead you should put all in a string array, adding the broked and sink args in the end and then use that slice to put into the RunWithOpts call (with "..." to convert to varargs)
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.
yeah. fixing it.
96ff88c
to
21e56cd
Compare
8571a03
to
f928f6c
Compare
The following is the coverage report on the affected files.
|
/test pull-knative-client-integration-tests |
@rhuss @maximilien @navidshaikh This PR is ready for review and merge if possible. Thanks. |
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.
thanks, lgtm !
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: daisy-ycguo, maximilien, rhuss 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 |
/retest
and
ref: logs |
Fixes #568
Proposed Changes