简体   繁体   中英

Pitest can't find mutations

I try to run "mvn clean test" to get the mutation coverage of my test's but it can't find anything. I ussed a lot of different settings but I can't find an solution. Could my settings be wrong ?

Pom.xml

<build>
    <plugins>

        <plugin>
            <groupId>org.pitest</groupId>
            <artifactId>pitest-maven</artifactId>
            <version>1.4.5</version>
            <executions>
                <execution>
                    <id>pitest-mutation-coverage</id>
                    <phase>test</phase>
                    <goals>
                        <goal>mutationCoverage</goal>
                    </goals>

                </execution>
            </executions>
            <dependencies>
                <dependency>
                    <groupId>org.pitest</groupId>
                    <artifactId>pitest-junit5-plugin</artifactId>
                    <version>0.8</version>
                </dependency>
            </dependencies>
            <configuration>
                <targetClasses>
                    <param>at.my.swtesting.*</param>
                </targetClasses>
                <targetTests>
                    <param>at.my.swtesting.*</param>
                </targetTests>    
            </configuration>
        </plugin>

    </plugins>
</build>

Important Log Messages:

08:14:47 PIT >> INFO : Verbose logging is disabled. If you encounter a problem, please enable it before reporting an issue.
08:14:47 PIT >> INFO : Sending 4 test classes to minion
08:14:47 PIT >> INFO : Sent tests to minion
08:14:47 PIT >> INFO : MINION : 08:14:47 PIT >> INFO : Checking environment

08:14:48 PIT >> INFO : MINION : 08:14:48 PIT >> INFO : Found  0 tests

08:14:48 PIT >> INFO : MINION : 08:14:48 PIT >> INFO : Dependency analysis reduced number of potential tests by 0

08:14:48 PIT >> INFO : MINION : 08:14:48 PIT >> INFO : 0 tests received

08:14:48 PIT >> INFO : Calculated coverage in 0 seconds.
08:14:48 PIT >> INFO : Created  0 mutation test units

[ERROR] Failed to execute goal org.pitest:pitest-maven:1.4.5:mutationCoverage (pitest-mutation-coverage) on project exercise01-assignment01: Execution pitest-mutation-coverage of goal org.pitest:pitest-maven:1.4.5:mutationCoverage failed: No mutations found. This probably means there is an issue with either the supplied classpath or filters.

You have configured 'at.my.swtesting.*' as targetclasses so pit will try to mutate classes inside 'swtesting' package.

Make sure source classes are present inside 'swtesting' package so that pit can find them and mutate the code.

Just add a demo class and method. do some addition in the method and print the output.

if supplied classpath is ok then mutation report should be generated.

Upon running pit, 'pitClasspath' file is also generated which lists all files in the pit classpath. check that as well.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM