-
Notifications
You must be signed in to change notification settings - Fork 250
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
Refactor PipelineRun and TaskRun Cancel Error Based on Condition Status #1189
Conversation
The following is the coverage report on the affected files.
|
Status: duckv1beta1.Status{ | ||
Conditions: duckv1beta1.Conditions{ | ||
{ | ||
Status: corev1.ConditionUnknown, |
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.
This should be changed to Unknown since it needs to make it through the validation of whether or not the TaskRun has finished or not.
@@ -311,7 +322,7 @@ func TestTaskRunCancel_v1beta1(t *testing.T) { | |||
Status: duckv1beta1.Status{ | |||
Conditions: duckv1beta1.Conditions{ | |||
{ | |||
Status: corev1.ConditionTrue, | |||
Status: corev1.ConditionUnknown, |
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.
This should be changed to Unknown since it needs to make it through the validation of whether or not the TaskRun has finished or not.
@@ -242,7 +253,7 @@ func TestTaskRunCancel_v1beta1(t *testing.T) { | |||
Status: duckv1beta1.Status{ | |||
Conditions: duckv1beta1.Conditions{ | |||
{ | |||
Status: corev1.ConditionTrue, | |||
Status: corev1.ConditionUnknown, |
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.
This should be changed since the TaskRun is in a running state, so its Condition status should be unknown.
Status: duckv1beta1.Status{ | ||
Conditions: duckv1beta1.Conditions{ | ||
{ | ||
Status: corev1.ConditionUnknown, |
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.
This should be changed to Unknown since it needs to make it through the validation of whether or not the PipelineRun has finished or not.
@@ -369,6 +411,16 @@ func Test_cancel_pipelinerun_v1beta1(t *testing.T) { | |||
}, | |||
}, | |||
}, | |||
Status: v1alpha1.PipelineRunStatus{ |
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.
Adding status here since the test is for a successful cancel, which means the PipelineRun should be in a running state.
/test pull-tekton-cli-integration-tests |
/test pull-tekton-cli-integration-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.
/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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: pradeepitm12 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 |
#1194 | [Daniel Helfand] update README to v0.13.0 | 2020/09/30-22:18 #1196 | [Chmouel Boudjnah] Update OSX instruction to install from brew 🍻 | 2020/10/02-11:36 #1197 | [Daniel Helfand] reorganize release process docs and add details | 2020/10/07-07:26 #1192 | [Daniel Helfand] add eventlistener logs command | 2020/10/07-08:00 #1198 | [Matt Moore] Bump Knative/K8s dependencies | 2020/10/08-00:34 #1201 | [Daniel Helfand] avoid use of previous TaskRunSpecStatus and PipelineRunSpecStatus | 2020/10/13-17:32 #1205 | [Daniel Helfand] remove assertions to help with debugging eventlistener e2e failures | 2020/10/20-07:27 #1207 | [Piyush Garg] tkn pr describe failing in pr with conditions | 2020/10/20-08:57 #1189 | [Daniel Helfand] refactor pipelinerun and taskrun cancel err based on condition status | 2020/10/20-09:15 #1189 | [Daniel Helfand] add pipelinerun and taskrun cancel e2e tests | 2020/10/20-09:15 null | [Daniel Helfand] common way of referring to tekton resources in user facing messages: EventListener | 2020/10/21-07:21 null | [Daniel Helfand] common way of referring to tekton resources in user facing messages: TriggerBinding | 2020/10/21-08:00 Signed-off-by: Piyush Garg <pgarg@redhat.com>
Closes #1188
Instead of validating based on the result of
formatted.Condition
, the validation should check whether the condition status of the run isConditionUnknown
, which indicates the PipelineRun or TaskRun is still running and can be cancelled. There needed to be some minor tweaks to unit tests which had condition statuses for running that were incorrect.Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
make check
make generated
Release Notes