@@ -47,7 +47,9 @@ public class FeatureTestResultEvaluator extends Evaluator<TestResultsAuditRespon
47
47
private static final String TEST_CASE_SUCCESS_COUNT = "successTestCaseCount" ;
48
48
private static final String TEST_CASE_FAILURE_COUNT = "failureTestCaseCount" ;
49
49
private static final String TEST_CASE_SKIPPED_COUNT = "skippedTestCaseCount" ;
50
+ private static final String TEST_CASE_UNKNOWN_COUNT = "unknownStatusTestCaseCount" ;
50
51
private static final String TEST_CASE_TOTAL_COUNT = "totalTestCaseCount" ;
52
+
51
53
private static final String PRIORITY_HIGH = "High" ;
52
54
53
55
@@ -153,6 +155,7 @@ private TestResultsAuditResponse updateTestResultAuditStatuses(List<TestCapabili
153
155
}
154
156
155
157
double testCasePassPercent = this .getTestCasePassPercent (testCapabilities );
158
+
156
159
if (testCasePassPercent < threshold ) {
157
160
testResultsAuditResponse .addAuditStatus (TestResultAuditStatus .TEST_RESULT_AUDIT_FAIL );
158
161
} else {
@@ -180,13 +183,16 @@ private double getTestCasePassPercent(List<TestCapability> testCapabilities) {
180
183
double testCaseSkipCount = testCapabilities .stream ().mapToDouble (testCapability ->
181
184
testCapability .getTestSuites ().parallelStream ().mapToDouble (TestSuite ::getSkippedTestCaseCount ).sum ()
182
185
).sum ();
186
+ double testCaseUnkownCount = testCapabilities .stream ().mapToDouble (testCapability ->
187
+ testCapability .getTestSuites ().parallelStream ().mapToDouble (TestSuite ::getUnknownStatusCount ).sum ()
188
+ ).sum ();
183
189
184
- if (totalTestCaseCount == 0 || testCaseSkipCount == totalTestCaseCount ){
190
+ if (totalTestCaseCount == 0 || ( testCaseSkipCount + testCaseUnkownCount ) == totalTestCaseCount ){
185
191
return 100.0 ;
186
192
}
187
193
188
- return (testCaseSuccessCount /(totalTestCaseCount - testCaseSkipCount )) * 100 ;
189
-
194
+ return (testCaseSuccessCount /(totalTestCaseCount - testCaseSkipCount - testCaseUnkownCount )) * 100 ;
195
+
190
196
}catch (Exception e ){
191
197
LOGGER .error ("Could not get 'testCasePassPercent', setting to 0.0%" );
192
198
return 0.0 ;
@@ -215,11 +221,15 @@ protected HashMap getFeatureTestResult(TestResult testResult) {
215
221
testCapability .getTestSuites ().parallelStream ().mapToInt (TestSuite ::getFailedTestCaseCount ).sum ()).sum ();
216
222
int testCaseSkippedCount = testCapabilities .stream ().mapToInt (testCapability ->
217
223
testCapability .getTestSuites ().parallelStream ().mapToInt (TestSuite ::getSkippedTestCaseCount ).sum ()).sum ();
224
+ int testCaseUnknownCount = testCapabilities .stream ().mapToInt (testCapability ->
225
+ testCapability .getTestSuites ().parallelStream ().mapToInt (TestSuite ::getUnknownStatusCount ).sum ()).sum ();
218
226
219
227
featureTestResultMap .put (TEST_CASE_TOTAL_COUNT , totalTestCaseCount );
220
228
featureTestResultMap .put (TEST_CASE_SUCCESS_COUNT , testCaseSuccessCount );
221
229
featureTestResultMap .put (TEST_CASE_FAILURE_COUNT , testCaseFailureCount );
222
230
featureTestResultMap .put (TEST_CASE_SKIPPED_COUNT , testCaseSkippedCount );
231
+ featureTestResultMap .put (TEST_CASE_UNKNOWN_COUNT , testCaseUnknownCount );
232
+
223
233
}catch (Exception e ){
224
234
LOGGER .error ("Exception occurred while processing testResult " + testResult .getDescription (), e );
225
235
}
0 commit comments