Skip to content

Commit

Permalink
#750 -DskipTests Flag should be honoured in a maven run without addit…
Browse files Browse the repository at this point in the history
…ional configuration
  • Loading branch information
marwin1991 committed Jan 30, 2022
1 parent 1c2d301 commit 7b19bf0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import org.slf4j.LoggerFactory;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
Expand Down Expand Up @@ -353,17 +354,14 @@ public void shouldCorrectlyHandleOverrides() throws Exception {
buildFilePath(testDir, "target", "site", "pit-reports").exists());
}

@Test
@Test(expected = FileNotFoundException.class)
public void shouldReadExclusionsFromSurefireConfig() throws Exception {
File testDir = prepare("/pit-surefire-excludes");
verifier.addCliOption("-DskipTests");
verifier.executeGoal("test");
verifier.executeGoal("org.pitest:pitest-maven:mutationCoverage");

String actual = readResults(testDir);
assertThat(actual)
.contains(
"<mutation detected='false' status='NO_COVERAGE' numberOfTestsRun='0'><sourceFile>NotCovered.java</sourceFile>");
readResults(testDir);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ public class AbstractPitMojo extends AbstractMojo {
/**
* honours common skipTests flag in a maven run
*/
@Parameter(defaultValue = "false")
@Parameter(property = "skipTests", defaultValue = "false")
private boolean skipTests;

/**
Expand Down

0 comments on commit 7b19bf0

Please sign in to comment.