Skip to content

Commit

Permalink
Fix unreachable code in TestReconcileCancelledFailsTaskRunCancellation
Browse files Browse the repository at this point in the history
Make that code reachable and fix the check to actually pass.

Signed-off-by: Andrew Bayer <andrew.bayer@gmail.com>
  • Loading branch information
abayer authored and tekton-robot committed Oct 13, 2021
1 parent 3036e22 commit 74f2de9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pkg/reconciler/pipelinerun/pipelinerun_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3230,9 +3230,8 @@ func TestReconcileCancelledFailsTaskRunCancellation(t *testing.T) {

if val, ok := reconciledRun.GetLabels()[pipeline.PipelineLabelKey]; !ok {
t.Fatalf("expected pipeline label")
if d := cmp.Diff("test-pipelines", val); d != "" {
t.Errorf("expected to see pipeline label. Diff %s", diff.PrintWantGot(d))
}
} else if d := cmp.Diff("test-pipeline", val); d != "" {
t.Errorf("expected to see pipeline label. Diff %s", diff.PrintWantGot(d))
}

// The PipelineRun should not be cancelled b/c we couldn't cancel the TaskRun
Expand Down

0 comments on commit 74f2de9

Please sign in to comment.