Skip to content

Commit d124445

Browse files
committed
Small logging improvements for spec tests.
- Include the file name in the error message of a failed spec test. - Add log message for total test count in SpecTestCase.
1 parent f79cf6b commit d124445

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

firebase-firestore/src/test/java/com/google/firebase/firestore/spec/SpecTestCase.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1119,6 +1119,9 @@ public void testSpecTests() throws Exception {
11191119
testNameFilter = Pattern.compile(testNameFilterFromSystemProperty);
11201120
}
11211121

1122+
int testPassCount = 0;
1123+
int testSkipCount = 0;
1124+
11221125
for (Pair<String, JSONObject> parsedSpecFile : parsedSpecFiles) {
11231126
String fileName = parsedSpecFile.first;
11241127
JSONObject fileJSON = parsedSpecFile.second;
@@ -1157,18 +1160,21 @@ public void testSpecTests() throws Exception {
11571160
info("Spec test: " + name);
11581161
runSteps(steps, config);
11591162
ranAtLeastOneTest = true;
1163+
testPassCount++;
11601164
} catch (AssertionError e) {
1161-
throw new AssertionError("Spec test failure: " + name, e);
1165+
throw new AssertionError("Spec test failure: " + name + " (" + fileName + ")", e);
11621166
}
11631167
long end = System.currentTimeMillis();
11641168
if (measureRuntime) {
11651169
info("Runtime: " + (end - start) + " ms");
11661170
}
11671171
} else {
1172+
testSkipCount++;
11681173
info(" [SKIPPED] Spec test: " + name);
11691174
}
11701175
}
11711176
}
1177+
info(getClass().getName() + " completed; pass=" + testPassCount + " skip=" + testSkipCount);
11721178
assertTrue(ranAtLeastOneTest);
11731179
}
11741180

0 commit comments

Comments
 (0)