Skip to content
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

Add throwables in CheckTestHasFailedResultListener #1087

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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 @@ -25,6 +25,7 @@ public class CheckTestHasFailedResultListener implements TestListener {

private final List<Description> succeedingTests = new ArrayList<>();
private final List<Description> failingTests = new ArrayList<>();
public final List<String> throwables = new ArrayList<>();
private final boolean recordPassingTests;
private int testsRun = 0;

Expand All @@ -35,6 +36,11 @@ public CheckTestHasFailedResultListener(boolean recordPassingTests) {
@Override
public void onTestFailure(final TestResult tr) {
this.failingTests.add(tr.getDescription());

if (tr.getThrowable() != null) {
// TO DO: expand the data that we capture from the throwable instance.
this.throwables.add(tr.getThrowable().getClass().descriptorString());
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,12 @@ private MutationStatusTestPair doTestsDetectMutation(final Container c,

private MutationStatusTestPair createStatusTestPair(
final CheckTestHasFailedResultListener listener) {

System.out.println("printing throwables!");
for (String t : listener.throwables) {
System.out.println(t);
}

List<String> failingTests = listener.getFailingTests().stream()
.map(Description::getQualifiedName).collect(Collectors.toList());
List<String> succeedingTests = listener.getSucceedingTests().stream()
Expand Down