0

I really wish to use PITEST for mutation coverage, but I don't know why I get this error all the time and whatever I do ( I'm using Pitest version : 1.6.7 , so I don't have to specify target tests and target classes ) :

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

 [ERROR] See http://pitest.org for more details.

Can you please help me with this, you can find my pom.xml below, and thank you for your answers.

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>1</groupId>
    <artifactId>2</artifactId>
    <version>2</version>
    <packaging>jar</packaging>

    <name>2</name>
    <description>Blank project for Vanilla Spring WebFlux.fn</description>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.1.0.RELEASE</version> <!-- lookup parent from repository -->
    </parent>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <java.version>1.8</java.version>
        <start-class>2.App</start-class>
        <spring-fu.version>0.0.3.BUILD-SNAPSHOT</spring-fu.version>
    </properties>


    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-webflux</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>javax.annotation</groupId>
                    <artifactId>javax.annotation-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.hibernate.validator</groupId>
                    <artifactId>hibernate-validator</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework.fu</groupId>
            <artifactId>spring-fu-jafu</artifactId>
            <version>${spring-fu.version}</version>
        </dependency>
        <dependency>
            <groupId>am.ik.yavi</groupId>
            <artifactId>yavi</artifactId>
            <version>0.0.18</version>
        </dependency>
          
        <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.11</version>
        <scope>test</scope>
    
        </dependency>
        
        <dependency>
            <groupId>org.pitest</groupId>
            <artifactId>pitest-parent</artifactId>
            <version>1.6.7</version>
            <type>pom</type>
    </dependency>
        
        <dependency>
            <groupId>io.projectreactor</groupId>
            <artifactId>reactor-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
            
            <plugin>
            <groupId>org.codehaus.mojo</groupId>
             <artifactId>cobertura-maven-plugin</artifactId>
             <version>2.5.1</version>
             <configuration>
             <formats>
                <format>html</format>
                <format>xml</format>
             </formats>
             </configuration>
           </plugin>
           
           <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>3.0.0-M5</version>
           </plugin>
           
           
           
           <plugin>
        <groupId>org.pitest</groupId>
        <artifactId>pitest-maven</artifactId>
        <version>1.6.7</version>
        <configuration>
            <verbose>true</verbose>
        </configuration>
        <executions>
                 <execution>
                    <id>pitest</id>
                   <phase>test</phase>
                  </execution>
             </executions>
         </plugin>


           
           <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <version>0.8.2</version>
            <executions>
                <execution>
                    <goals>
                            <goal>prepare-agent</goal>
                    </goals>
                </execution>
 
                <execution>
                    <id>report</id>
                    <phase>test</phase>
                    <goals>
                            <goal>report</goal>
                    </goals>
                </execution>
        </executions>
        </plugin>
         
        </plugins>
    </build>

    <repositories>
        <repository>
            <id>spring-snapshots</id>
            <name>Spring Snapshots</name>
            <url>https://repo.spring.io/snapshot</url>
            <snapshots>
            </snapshots>
        </repository>
        <repository>
            <id>spring-milestones</id>
            <name>Spring Milestones</name>
            <url>https://repo.spring.io/milestone</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>spring-snapshots</id>
            <name>Spring Snapshots</name>
            <url>https://repo.spring.io/snapshot</url>
            <snapshots>
            </snapshots>
        </pluginRepository>
        <pluginRepository>
            <id>spring-milestones</id>
            <name>Spring Milestones</name>
            <url>https://repo.spring.io/milestone</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>

</project>

You can find my little project (1 classe & 1 test) in my google Drive using the link below :

https://drive.google.com/file/d/1GJ7ij5zK63J2E6uOJGYWprzp-bD_OgtK/view?usp=sharing

Let me know if you succed in generating mutations and pit-reports with it, it will help me a lot ! Thank you !

  • 1
    Does this answer your question? [PTTest is failing and not generating mutation coverage](https://stackoverflow.com/questions/32345833/pttest-is-failing-and-not-generating-mutation-coverage) – seenukarthi Jul 12 '21 at 12:14

0 Answers0