-
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
Support multiple arguments on revision delete #657
Support multiple arguments on revision delete #657
Conversation
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.
/retest
thanks!
just a few minor changes requested
test/e2e/revision_test.go
Outdated
existRevision1 := revisionNames[0] | ||
existRevision2 := revisionNames[1] | ||
nonexistRevision := revisionNames[2] | ||
out, err := test.kn.RunWithOpts([]string{"revision", "list"}, runOpts{NoNamespace: false}) | ||
assert.NilError(t, err) | ||
assert.Check(t, strings.Contains(out, existRevision1), "Required revision1 does not exist") | ||
assert.Check(t, strings.Contains(out, existRevision2), "Required revision2 does not exist") | ||
assert.Check(t, !strings.Contains(out, nonexistRevision), "Nonexistent revision does exist") |
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.
I think this block is not required as if the revision doesnt exist, it should be tested in delete check below.
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.
I'd rather keep it as if the tests before this one are moved around there might not be 2 revisions. Though I'll remove it if you feel strongly.
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.
In that case, your tests should generate revisions by its own and not rely on generating test artifacts by other tests.
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.
just a rewording request.
/retest The test should be more stable when #661 is merged. |
|
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.
--- FAIL: TestRevision/delete_three_revisions_with_one_revision_a_nonexistent (15.36s)
revision_test.go:111: assertion failed:
Actual output: Revision 'hello-zxgvs-1' deleted in namespace 'kne2etests0'.
Revision 'hello-vvpnh-2' deleted in namespace 'kne2etests0'.
revisions.serving.knative.dev "hello-nonexist" not found.
Missing strings: successfully: Failed to get 'successfully deleted' first revision message
revision_test.go:112: assertion failed:
Actual output: Revision 'hello-zxgvs-1' deleted in namespace 'kne2etests0'.
Revision 'hello-vvpnh-2' deleted in namespace 'kne2etests0'.
revisions.serving.knative.dev "hello-nonexist" not found.
Missing strings: successfully: Failed to get 'successfully deleted' second revision message
looks like tests need to be updated with change in messages
fixed the tests, and actually checked the tests TestRevisions before pushing :) |
The following is the coverage report on the affected files.
|
/retest |
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.
LGTM
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.
/lgtm
/approve
Thanks!
revName1 := "foo-12345" | ||
revName2 := "foo-67890" | ||
revName3 := "foo-abcde" | ||
action, _, output, err := fakeRevisionDelete([]string{"revision", "delete", revName1, revName2, revName3}) |
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.
Take a look at this unit tests framework we're using now https://github.com/knative/client/blob/master/pkg/kn/commands/service/service_update_mock_test.go#L32
We should eventually streamline all the unit tests to use single framework.
@@ -76,18 +89,31 @@ func (test *e2eTest) revisionListWithService(t *testing.T, serviceNames ...strin | |||
} | |||
} | |||
|
|||
func (test *e2eTest) revisionDelete(t *testing.T, serviceName string) { | |||
revName := test.findRevision(t, serviceName) |
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.
👍
@@ -50,7 +51,19 @@ func TestRevision(t *testing.T) { | |||
}) | |||
|
|||
t.Run("delete latest revision from hello service and return no error", func(t *testing.T) { | |||
test.revisionDelete(t, "hello") | |||
revName := test.findRevision(t, "hello") |
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.
👍
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: maximilien, navidshaikh, wslyln 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 |
attempt to solve this issue: knative/test-infra#638
Addresses #317
Release note:
kn revision delete