Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
- Improve error msgs to be more verbose
  • Loading branch information
shashwathi authored and knative-prow-robot committed Oct 18, 2018
1 parent 957ef50 commit 6b4d761
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/reconciler/v1alpha1/taskrun/taskrun_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ func TestReconcileBuildFetchError(t *testing.T) {
clients.bclient.PrependReactor("*", "*", reactor)

if err := c.Reconciler.Reconcile(context.Background(), fmt.Sprintf("%s/%s", taskRun.Namespace, taskRun.Name)); err == nil {
t.Fatal("expected error")
t.Fatal("expected error but got nil")
}
}

Expand Down Expand Up @@ -340,7 +340,7 @@ func TestReconcileBuildUpdateStatus(t *testing.T) {
}

if err := c.Reconciler.Reconcile(context.Background(), fmt.Sprintf("%s/%s", taskRun.Namespace, taskRun.Name)); err != nil {
t.Fatal("Unexpected error", err)
t.Fatalf("Unexpected error when Reconcile() : %v", err)
}

newTr, err := clients.taskrunInformer.Lister().TaskRuns(taskRun.Namespace).Get(taskRun.Name)
Expand All @@ -360,7 +360,7 @@ func TestReconcileBuildUpdateStatus(t *testing.T) {

_, err = clients.bclient.BuildV1alpha1().Builds(taskRun.Namespace).Update(build)
if err != nil {
t.Errorf("Unexpected error creating build: %v", err)
t.Errorf("Unexpected error while creating build: %v", err)
}

if err := c.Reconciler.Reconcile(context.Background(), fmt.Sprintf("%s/%s", taskRun.Namespace, taskRun.Name)); err != nil {
Expand All @@ -369,7 +369,7 @@ func TestReconcileBuildUpdateStatus(t *testing.T) {

newTr, err = clients.taskrunInformer.Lister().TaskRuns(taskRun.Namespace).Get(taskRun.Name)
if err != nil {
t.Errorf("Unexpected error fetching taskrun: %v", err)
t.Fatalf("Unexpected error fetching taskrun: %v", err)
}
if d := cmp.Diff(newTr.Status.GetCondition(duckv1alpha1.ConditionSucceeded), buildSt, ignoreLastTransitionTime); d != "" {
t.Fatalf("Taskrun Status diff -want, +got: %v", d)
Expand Down

0 comments on commit 6b4d761

Please sign in to comment.