0

I'm integrating mutaiton testing using pitest plugin in my intellij here is my plugin for pitest

 <plugin>
                <groupId>org.pitest</groupId>
                <artifactId>pitest-maven</artifactId>
                <version>1.5.2</version>
                <executions>
                    <execution>
                        <phase>test</phase>
                        <goals>
                            <goal>mutationCoverage</goal>
                        </goals>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>org.pitest</groupId>
                        <artifactId>pitest-junit5-plugin</artifactId>
                        <version>0.12</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <outputFormats>
                        <outputFormat>XML</outputFormat>
                        <outputFormat>HTML</outputFormat>
                    </outputFormats>
                        <mutationThreshold>0</mutationThreshold>
                        <threads>2</threads>
                        <verbose>true</verbose>
                        <testPlugin>junit</testPlugin>
                    <targetClasses> <!-- target classes was found to be needed when setting up 
     with sonar -->
                        <param>com.mypackage.controller.*</param>
                        <param>com.mypackage.service.*</param>
                    </targetClasses>
                    <targetTests>  <!-- target tests was found to be needed when setting up with 
     sonar -->
                        <param>com.mypackage.rootfolder.*</param> <!-- update to point to the 
     tests that cover your functional code -->
                    </targetTests>
                </configuration>
            </plugin>

i get this ouptut when i run pitest runner in my ide , its not detecting the test classes even though the path i provided in configuration is correct , Please advise

11:45:30 AM PIT >> INFO : Verbose logging is disabled. If you encounter a problem, please enable it before reporting an issue. 11:45:31 AM PIT >> INFO : Sending 14 test classes to minion 11:45:31 AM PIT >> INFO : Sent tests to minion 11:45:31 AM PIT >> INFO : MINION : 11:45:31 AM PIT >> INFO : Checking environment 11:45:32 AM PIT >> INFO : MINION : 11:45:32 AM PIT >> INFO : Found 0 tests 11:45:32 AM PIT >> INFO : MINION : 11:45:32 AM PIT >> INFO : Dependency analysis reduced number of potential tests by 0 11:45:32 AM PIT >> INFO : MINION : 11:45:32 AM PIT >> INFO : 0 tests received 11:45:32 AM PIT >> INFO : Calculated coverage in 1 seconds.

5
  • Are you using junit or junit5? You have installed the junit5 plugin, but have set testPlugin to "junit". Commented Jan 21, 2022 at 11:41
  • You are also using quite an old version of pitest. The latest is 1.7.3. Commented Jan 21, 2022 at 11:42
  • Thanks Henry! I'm using Junit5 and updated version to 1.7.3 and test plugin set to junit5 but still shows zero tests found when i run pitest in my local ``` Commented Jan 24, 2022 at 18:12
  • Thanks Henry! I'm using Junit5 and updated version to 1.7.3 and test plugin set to junit5 but still shows zero tests found when i run pitest in my local mvn test finds the test though ` Commented Jan 24, 2022 at 18:14
  • I'm getting this exception after updating as above.. please advise 12:39:43 PM PIT >> SEVERE : Error generating coverage. Please check that your classpath contains modern JUnit 4 or PIT test plugin for other test tool (JUnit 5, TestNG, ...) is enabled. Exception in thread "main" org.pitest.util.PitError: Coverage generation minion exited abnormally. Please check the classpath and/or enable test plugin for used test tool. Commented Jan 24, 2022 at 18:43

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.