question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MutationResult.getSucceedingTests() always returns empty list

See original GitHub issue

Trying to write a MutationResultListener to generate specific reports. My class extends org.pitest.mutationtest.MutationResultListener .

In the handleMutationResult(ClassMutationResults results) method, I tried the following:

for (MutationResult mutation : results.getMutations()) {
    List<String> succedingTests = mutation.getSucceedingTests();
    for(String succedingtest : succedingTests) {
        out.println("Succeeding test:" + succedingtest);
    }
    List<String> killingTests = mutation.getKillingTests();
    for(String killingtest : killingTests) {
        out.println("Killing test:" + killingtest);
    }
}

The code is properly called (and getKillingTests() works fine).

But the list returned by getSucceedingTests() is always empty (either mutations are killed, or not, or part of them).

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
gibellocommented, May 21, 2019

Thanks; The fullMutationMatrix parameter is not documented… but I found it in the release notes. Problem, when set, my listener is never called: I get a message saying “Full mutation matrix is only supported in the output format XML”, so I can’t use any output format of my own.

0reactions
victorgvelosocommented, Apr 28, 2020

Yes, it works but… I had to set outputFormats for both my format and XML. outputFormats = ['DetailedCSV','XML']. Otherwise the error “Full mutation matrix is only supported in the output format XML” appears. Searching for this string I found org.pitest.mutationtest.tooling.EntryPoint. There is a method with a hardcoded condition:

private void checkMatrixMode(ReportOptions data) {
    if (data.isFullMutationMatrix() && !data.getOutputFormats().contains("XML")) {
      throw new PitError("Full mutation matrix is only supported in the output format XML.");
    }
  }

It explicitly blocks the use of fullMutationMatrix for ‘XML’-containing outputFormats only.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Couchbase MuteteInResult always returns Index 0 is invalid ...
In couchbase java sdk I am trying to change a Boolean field in database. I am trying to do as following: public boolean...
Read more >
S3 Common Prefixes Incorrectly Returns Empty List #1576
The Java code is below. But when I try to list the top-level "folders" in an S3 bucket, I get an empty list....
Read more >
Empty array in update payload on update(set) mutation
Report a GraphQL Bug On update (set) mutation the returned array of updated elements is always empty. This doesn't happen with add mutation ......
Read more >
Should I return a null value or an empty collection? - Reddit
Return a constant empty collection...which is trivial in Java. Collections.emptyList() will always return the same object, which makes it essentially free.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found