Skip to content

Commit a8ec3fe

Browse files
committed
pkg/monitortests/clusterversionoperator/legacycvomonitortests: Return happy-case pass JUnit
Avoid issues in aggregated jobs like [1]: : [bz-DNS] clusteroperator/dns should not change condition/Degraded expand_less 0s {Passed 4 times, failed 0 times, skipped 0 times: we require at least 6 attempts to have a chance at success name: '[bz-DNS] clusteroperator/dns should not change condition/Degraded' where of the 10 runs, 4 flaked, and the rest did not include JUnit for this test-case at all. With this pivot, the happy jobs will have JUnit for the test-case asserting that the test suite is completely happy with how this ClusterOperator handled Degraded.
1 parent 53f239e commit a8ec3fe

File tree

1 file changed

+11
-13
lines changed
  • pkg/monitortests/clusterversionoperator/legacycvomonitortests

1 file changed

+11
-13
lines changed

pkg/monitortests/clusterversionoperator/legacycvomonitortests/operators.go

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,6 @@ func testOperatorStateTransitions(events monitorapi.Intervals, conditionTypes []
167167
}
168168
}
169169

170-
if len(fatal) == 0 && len(excepted) == 0 {
171-
continue // nothing to complain about
172-
}
173-
174170
output := fmt.Sprintf("%d unexpected clusteroperator state transitions during e2e test run", len(fatal))
175171
if len(fatal) > 0 {
176172
output = fmt.Sprintf("%s. These did not match any known exceptions, so they cause this test-case to fail:\n\n%v\n", output, strings.Join(fatal, "\n"))
@@ -184,17 +180,19 @@ func testOperatorStateTransitions(events monitorapi.Intervals, conditionTypes []
184180
output = fmt.Sprintf("%s, as desired.", output)
185181
}
186182

187-
ret = append(ret, &junitapi.JUnitTestCase{
188-
Name: testName,
189-
Duration: duration,
190-
SystemOut: output,
191-
FailureOutput: &junitapi.FailureOutput{
192-
Output: output,
193-
},
194-
})
183+
if len(fatal) > 0 || len(excepted) > 0 {
184+
ret = append(ret, &junitapi.JUnitTestCase{
185+
Name: testName,
186+
Duration: duration,
187+
SystemOut: output,
188+
FailureOutput: &junitapi.FailureOutput{
189+
Output: output,
190+
},
191+
})
192+
}
195193

196194
if len(fatal) == 0 {
197-
// add a success so we flake and don't fail
195+
// add a success so we flake (or pass) and don't fail
198196
ret = append(ret, &junitapi.JUnitTestCase{Name: testName})
199197
}
200198
}

0 commit comments

Comments
 (0)