File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed
src/main/java/io/jenkins/plugins Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -106,6 +106,10 @@ void execute(
106106 }
107107
108108 renderer .onComplete ();
109+
110+ if (renderer .isFailed ()) {
111+ throw new IOException ("SedStart Cloud run failed" );
112+ }
109113 }
110114 }
111115
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ final class SedStartSseRenderer {
99 private static final ObjectMapper MAPPER = new ObjectMapper ();
1010 private final TaskListener listener ;
1111
12- private String lastTestStatus ;
12+ private String finalStatus ;
1313
1414 SedStartSseRenderer (TaskListener listener ) {
1515 this .listener = listener ;
@@ -46,8 +46,6 @@ private void renderTestSnapshot(JsonNode test) {
4646 renderTestStep (step );
4747 }
4848 }
49-
50- lastTestStatus = status ;
5149 }
5250
5351 private void renderTestStep (JsonNode step ) {
@@ -90,6 +88,9 @@ private void renderRun(JsonNode run) {
9088
9189 if (!status .isEmpty ()) {
9290 listener .getLogger ().println (icon (status ) + " " + status );
91+ if ("PASS" .equalsIgnoreCase (status ) || "FAIL" .equalsIgnoreCase (status )) {
92+ finalStatus = status ;
93+ }
9394 }
9495
9596 JsonNode video = run .path ("video" );
@@ -103,9 +104,15 @@ private void renderRun(JsonNode run) {
103104 }
104105 }
105106
107+ boolean isFailed () {
108+ return "FAIL" .equalsIgnoreCase (finalStatus );
109+ }
110+
106111 void onComplete () {
107- if ("PASS" .equalsIgnoreCase (lastTestStatus )) {
112+ if ("PASS" .equalsIgnoreCase (finalStatus )) {
108113 listener .getLogger ().println ("✅ PASS" );
114+ } else if ("FAIL" .equalsIgnoreCase (finalStatus )) {
115+ listener .getLogger ().println ("❌ FAIL" );
109116 }
110117 }
111118
You can’t perform that action at this time.
0 commit comments