Skip to content

Small logging improvements for spec tests. #1373

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 19, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1109,8 +1109,7 @@ public void testSpecTests() throws Exception {
parsedSpecFiles.add(new Pair<>(f.getName(), fileJSON));
}

String testNameFilterFromSystemProperty =
emptyToNull(System.getProperty(TEST_FILTER_PROPERTY));
String testNameFilterFromSystemProperty = emptyToNull(System.getProperty(TEST_FILTER_PROPERTY));
Pattern testNameFilter;
if (testNameFilterFromSystemProperty == null) {
testNameFilter = null;
Expand All @@ -1119,6 +1118,9 @@ public void testSpecTests() throws Exception {
testNameFilter = Pattern.compile(testNameFilterFromSystemProperty);
}

int testPassCount = 0;
int testSkipCount = 0;

for (Pair<String, JSONObject> parsedSpecFile : parsedSpecFiles) {
String fileName = parsedSpecFile.first;
JSONObject fileJSON = parsedSpecFile.second;
Expand Down Expand Up @@ -1157,18 +1159,21 @@ public void testSpecTests() throws Exception {
info("Spec test: " + name);
runSteps(steps, config);
ranAtLeastOneTest = true;
testPassCount++;
} catch (AssertionError e) {
throw new AssertionError("Spec test failure: " + name, e);
throw new AssertionError("Spec test failure: " + name + " (" + fileName + ")", e);
}
long end = System.currentTimeMillis();
if (measureRuntime) {
info("Runtime: " + (end - start) + " ms");
}
} else {
testSkipCount++;
info(" [SKIPPED] Spec test: " + name);
}
}
}
info(getClass().getName() + " completed; pass=" + testPassCount + " skip=" + testSkipCount);
assertTrue(ranAtLeastOneTest);
}

Expand Down