Skip to content

Commit

Permalink
Rewrite test conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
othomann committed Mar 2, 2020
1 parent 2a86059 commit 20244f9
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pkg/reconciler/pipelinerun/pipelinerun_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1760,11 +1760,15 @@ func TestReconcileWithTaskResults(t *testing.T) {
),
)
// Check that the expected TaskRun was created
actual, err := clients.Pipeline.TektonV1alpha1().TaskRuns("foo").Get(expectedTaskRunName, metav1.GetOptions{})
actual, err := clients.Pipeline.TektonV1alpha1().TaskRuns("foo").List(metav1.ListOptions{})
if err != nil {
t.Fatalf("Expected a TaskRun to be created, but it wasn't: %s", err)
}
if d := cmp.Diff(actual, expectedTaskRun); d != "" {
t.Errorf("expected to see TaskRun %v created. Diff %s", expectedTaskRunName, d)
for _, taskRun := range actual.Items {
if taskRun.Name == expectedTaskRunName {
if d := cmp.Diff(taskRun, *expectedTaskRun); d != "" {
t.Errorf("expected to see TaskRun %v created. (-want, +got) Diff %s", expectedTaskRunName, d)
}
}
}
}

0 comments on commit 20244f9

Please sign in to comment.