Skip to content

Commit acf6e56

Browse files
authored
Merge pull request redhat-appstudio#250 from gabemontero/exit-e2e-if-failed
periodic not failing when initial pr fails
2 parents 97e71c4 + b4384c8 commit acf6e56

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

openshift-with-appstudio-test/e2e/jvm_build_service_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,13 @@ func TestExampleRun(t *testing.T) {
110110
ta.Logf(fmt.Sprintf("in flight pipeline run: %s", pr.Name))
111111
return false, nil
112112
}
113-
if pr.IsDone() && !pr.GetStatusCondition().GetCondition(apis.ConditionSucceeded).IsTrue() {
113+
if !pr.GetStatusCondition().GetCondition(apis.ConditionSucceeded).IsTrue() {
114114
prBytes, err := json.MarshalIndent(pr, "", " ")
115115
if err != nil {
116116
ta.Logf(fmt.Sprintf("problem marshalling failed pipelinerun to bytes: %s", err.Error()))
117117
return false, nil
118118
}
119-
return false, fmt.Errorf("pipeline run did not succeed: %s", string(prBytes))
119+
debugAndFailTest(ta, fmt.Sprintf("unsuccessful pipeline run: %s", string(prBytes)))
120120
}
121121
return true, nil
122122
})

openshift-with-appstudio-test/e2e/periodic_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ import (
1919
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1"
2020

2121
corev1 "k8s.io/api/core/v1"
22-
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2322
"k8s.io/apimachinery/pkg/api/resource"
23+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2424
"k8s.io/apimachinery/pkg/util/wait"
2525
"knative.dev/pkg/apis"
2626
)
@@ -136,15 +136,15 @@ func TestServiceRegistry(t *testing.T) {
136136
return false, nil
137137
}
138138
ta.Logf(fmt.Sprintf("in flight pipeline run: %s", string(prBytes)))
139+
return false, nil
139140
}
140141
if !pr.GetStatusCondition().GetCondition(apis.ConditionSucceeded).IsTrue() {
141142
prBytes, err := json.MarshalIndent(pr, "", " ")
142143
if err != nil {
143144
ta.Logf(fmt.Sprintf("problem marshalling failed pipelinerun to bytes: %s", err.Error()))
144145
return false, nil
145146
}
146-
ta.Logf(fmt.Sprintf("not yet successful pipeline run: %s", string(prBytes)))
147-
147+
debugAndFailTest(ta, fmt.Sprintf("unsuccessful pipeline run: %s", string(prBytes)))
148148
}
149149
return true, nil
150150
})

0 commit comments

Comments
 (0)