Error on runningpitest

299 views
Skip to first unread message

Shweta Gupta

unread,
Jul 7, 2020, 6:28:42 AM7/7/20
to PIT Users
I am new to pitest, i am following the MVN quick start guide, after added the following dependencies-

<dependency>
    <groupId>org.testng</groupId>
    <artifactId>testng</artifactId>
    <version>7.1.0</version>
    <scope>test</scope>
</dependency>

<dependency>
  <groupId>au.com.dius.pact.provider</groupId>
  <artifactId>junit</artifactId>
  <version>4.1.6</version>
</dependency>

<dependency>
  <groupId>org.pitest</groupId>
  <artifactId>pitest-maven</artifactId>
  <version>1.5.2</version>
  <type>maven-plugin</type>
</dependency>

 
  </dependencies>
  
  <build>
  <plugins>
  <plugin>
        <groupId>org.pitest</groupId>
        <artifactId>pitest-maven</artifactId>
        <version>1.5.2</version>
        <dependencies>
          <dependency>
            <groupId>org.pitest</groupId>
            <artifactId>pitest-junit4.1.6-plugin</artifactId>
            <version>0.10-SNAPSHOT</version>
          </dependency>
        </dependencies>
      </plugin>
    </plugins>
  </build>


I ran the project using command - mvn org.pitest:pitest-maven:mutationCoverage

I am getting this error on console -

[ERROR] Failed to execute goal org.pitest:pitest-maven:1.5.2:mutationCoverage (default-cli) on project demoPitsFramework: Execution default-cli of goal org.pitest:pitest-maven:1.5.2:mutationCoverage failed: Plugin org.pitest:pitest-maven:1.5.2 or one of its dependencies could not be resolved: Could not find artifact org.pitest:pitest-junit4.1.6-plugin:jar:0.10-SNAPSHOT -> [Help 1]

Could somebody please help me with this !

Ullrich Hafner

unread,
Jul 7, 2020, 9:01:50 AM7/7/20
to pitu...@googlegroups.com
Where did you found those versions? Try:

<dependency>
    <groupId>org.testng</groupId>
    <artifactId>testng</artifactId>
    <version>7.1.0</version>
    <scope>test</scope>
</dependency>

<dependency>
  <groupId>au.com.dius.pact.provider</groupId>
  <artifactId>junit</artifactId>
  <version>4.1.6</version>
</dependency>

  </dependencies>
  
  <build>
   <plugins>
   <plugin>
         <groupId>org.pitest</groupId>
         <artifactId>pitest-maven</artifactId>
         <version>1.5.2</version>
       </plugin>
    </plugins>
  </build>


--
You received this message because you are subscribed to the Google Groups "PIT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pitusers+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pitusers/e4b29d5f-454b-44a4-9335-39059cd4cfcan%40googlegroups.com.

Shweta Gupta

unread,
Jul 7, 2020, 10:56:48 AM7/7/20
to pitu...@googlegroups.com
Cool ! This worked.

Thanks Ullrich :)

Shweta Gupta

SDET

shg...@watermarkinsights.com

www.watermarkinsights.com

Netsmartz Square 

IT-C 9, Sector 67, Chandigarh                                                

https://lh6.googleusercontent.com/JQ_osqAhqqpuT7VL-jE97nBwtZ9-4wvM6P1zZx6v4L7z9C5eLdYrIPGQS9Px3bvW49jN01dfM1aMh061TMcAT3iCwpty855f3-UEB9_fM5f6HkBkXaTJH0MyvDGcq0mv4MHwxUph

We’re excited to announce that EvaluationKIT and Digital Measures have joined the Watermark family. Together, our mission is to put better data into the hands of administrators, faculty, and students everywhere in order to empower them to make meaningful improvements.



You received this message because you are subscribed to a topic in the Google Groups "PIT Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pitusers/Oi69Nw6wIAU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pitusers+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pitusers/7C9E5FCD-4D77-449C-B605-D7B9F64367AF%40gmail.com.

Shweta Gupta

unread,
Jul 7, 2020, 11:23:35 AM7/7/20
to pitu...@googlegroups.com
Though the reports were generated by using the above dependencies, I don't think PIT is actually working because no matter what I do, the reports show 0% coverage. 

PFA the snapshot for your reference.

Could anybody please tell me what am I missing?


Shweta Gupta

SDET

shg...@watermarkinsights.com

www.watermarkinsights.com

Netsmartz Square 

IT-C 9, Sector 67, Chandigarh                                                

https://lh6.googleusercontent.com/JQ_osqAhqqpuT7VL-jE97nBwtZ9-4wvM6P1zZx6v4L7z9C5eLdYrIPGQS9Px3bvW49jN01dfM1aMh061TMcAT3iCwpty855f3-UEB9_fM5f6HkBkXaTJH0MyvDGcq0mv4MHwxUph

We’re excited to announce that EvaluationKIT and Digital Measures have joined the Watermark family. Together, our mission is to put better data into the hands of administrators, faculty, and students everywhere in order to empower them to make meaningful improvements.

issue.png

Ullrich Hafner

unread,
Jul 7, 2020, 1:07:20 PM7/7/20
to pitu...@googlegroups.com
What does maven report when PIT is invoked? Without log it is hard to guess what is going wrong….

Shweta Gupta

unread,
Jul 7, 2020, 1:48:39 PM7/7/20
to pitu...@googlegroups.com, ullrich...@gmail.com
The logs-

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/usr/share/maven/lib/guice.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[INFO] Scanning for projects...
[INFO]
[INFO] ----------------< demoPitsFramework:demoPitsFramework >-----------------
[INFO] Building demoPitsFramework 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- pitest-maven:1.5.2:mutationCoverage (default-cli) @ demoPitsFramework ---
[INFO] Found plugin : Default csv report plugin
[INFO] Found plugin : Default xml report plugin
[INFO] Found plugin : Default html report plugin
[INFO] Found plugin : Static initializer code detector plugin
[INFO] Found plugin : Static initializer filter plugin
[INFO] Found plugin : Excluded annotations plugin
[INFO] Found plugin : Try with resources filter
[INFO] Found plugin : Inlined finally block filter plugin
[INFO] Found plugin : Implicit null check filter
[INFO] Found plugin : Method reference null check filter
[INFO] Found plugin : For each loop filter
[INFO] Found plugin : Enum constructor filter
[INFO] Found plugin : Logging calls filter
[INFO] Found plugin : Infinite for loop filter
[INFO] Found plugin : Long running iterator loop filter
[INFO] Found plugin : For loop counter filter
[INFO] Found plugin : Kotlin junk mutations filter
[INFO] Found plugin : Max mutations per class limit
[INFO] Found plugin : Equals shortcut equivalent mutant filter
[INFO] Found plugin : Trivial return vals equivalence filter
[INFO] Found plugin : Mutant export plugin
[INFO] Found shared classpath plugin : Default mutation engine
[INFO] Found shared classpath plugin : JUnit plugin
[INFO] Found shared classpath plugin : TestNG plugin
[INFO] Adding org.pitest:pitest to SUT classpath
[INFO] Mutating from /home/wm/Documents/Webapps/Demo/target/classes
[INFO] Defaulting target classes to match packages in build directory
[INFO] Defaulting target tests to match packages in test build directory
8:48:46 PM PIT >> INFO : Verbose logging is disabled. If you encounter a problem, please enable it before reporting an issue.
8:48:46 PM PIT >> INFO : Sending 3 test classes to minion
8:48:46 PM PIT >> INFO : Sent tests to minion
8:48:46 PM PIT >> INFO : MINION : 8:48:46 PM PIT >> INFO : Checking environment

8:48:47 PM PIT >> INFO : MINION : 8:48:47 PM PIT >> INFO : Found  0 tests

8:48:47 PM PIT >> INFO : MINION : 8:48:47 PM PIT >> INFO : Dependency analysis reduced number of potential tests by 0

8:48:47 PM PIT >> INFO : MINION : 8:48:47 PM PIT >> INFO : 0 tests received

8:48:47 PM PIT >> INFO : Calculated coverage in 0 seconds.
8:48:47 PM PIT >> INFO : Incremental analysis reduced number of mutations by 0
8:48:47 PM PIT >> INFO : Created  2 mutation test units
8:48:47 PM PIT >> INFO : Completed in 0 seconds
-================================================================================
- Mutators
================================================================================
> org.pitest.mutationtest.engine.gregor.mutators.BooleanTrueReturnValsMutator
>> Generated 1 Killed 0 (0%)
> KILLED 0 SURVIVED 0 TIMED_OUT 0 NON_VIABLE 0
> MEMORY_ERROR 0 NOT_STARTED 0 STARTED 0 RUN_ERROR 0
> NO_COVERAGE 1
--------------------------------------------------------------------------------
> org.pitest.mutationtest.engine.gregor.mutators.EmptyObjectReturnValsMutator
>> Generated 1 Killed 0 (0%)
> KILLED 0 SURVIVED 0 TIMED_OUT 0 NON_VIABLE 0
> MEMORY_ERROR 0 NOT_STARTED 0 STARTED 0 RUN_ERROR 0
> NO_COVERAGE 1
--------------------------------------------------------------------------------
> org.pitest.mutationtest.engine.gregor.mutators.MathMutator
>> Generated 2 Killed 0 (0%)
> KILLED 0 SURVIVED 0 TIMED_OUT 0 NON_VIABLE 0
> MEMORY_ERROR 0 NOT_STARTED 0 STARTED 0 RUN_ERROR 0
> NO_COVERAGE 2
--------------------------------------------------------------------------------
> org.pitest.mutationtest.engine.gregor.mutators.BooleanFalseReturnValsMutator
>> Generated 2 Killed 0 (0%)
> KILLED 0 SURVIVED 0 TIMED_OUT 0 NON_VIABLE 0
> MEMORY_ERROR 0 NOT_STARTED 0 STARTED 0 RUN_ERROR 0
> NO_COVERAGE 2
--------------------------------------------------------------------------------
> org.pitest.mutationtest.engine.gregor.mutators.NegateConditionalsMutator
>> Generated 3 Killed 0 (0%)
> KILLED 0 SURVIVED 0 TIMED_OUT 0 NON_VIABLE 0
> MEMORY_ERROR 0 NOT_STARTED 0 STARTED 0 RUN_ERROR 0
> NO_COVERAGE 3
--------------------------------------------------------------------------------
================================================================================
- Timings
================================================================================
> scan classpath : < 1 second
> coverage and dependency analysis : < 1 second
> build mutation tests : < 1 second
> run mutation analysis : < 1 second
--------------------------------------------------------------------------------
> Total  : < 1 second
--------------------------------------------------------------------------------
================================================================================
- Statistics
================================================================================
>> Generated 9 mutations Killed 0 (0%)
>> Ran 0 tests (0 tests per mutation)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  2.974 s
[INFO] Finished at: 2020-07-07T20:48:47+05:30
[INFO] ------------------------------------------------------------------------


Shweta Gupta

SDET

shg...@watermarkinsights.com

www.watermarkinsights.com

Netsmartz Square 

IT-C 9, Sector 67, Chandigarh                                                

https://lh6.googleusercontent.com/JQ_osqAhqqpuT7VL-jE97nBwtZ9-4wvM6P1zZx6v4L7z9C5eLdYrIPGQS9Px3bvW49jN01dfM1aMh061TMcAT3iCwpty855f3-UEB9_fM5f6HkBkXaTJH0MyvDGcq0mv4MHwxUph

We’re excited to announce that EvaluationKIT and Digital Measures have joined the Watermark family. Together, our mission is to put better data into the hands of administrators, faculty, and students everywhere in order to empower them to make meaningful improvements.


Ullrich Hafner

unread,
Jul 7, 2020, 4:53:03 PM7/7/20
to pitu...@googlegroups.com
Seems that you are not using JUnit for your tests (or you do not use the typical file name patterns). I don’t know if that is supported. Does surefire pick up your test on `mvn test`?

Am 07.07.2020 um 22:31 schrieb Shweta Gupta <shg...@watermarkinsights.com>:

Hi,

Thank you so much for your help.

I have added a test class for my program, but still it shows Found 0 tests, if I don't add target classes in pom.xml

If I add the following code in pom.xml, it gives me an error saying "Execution default-cli of goal org.pitest:pitest-maven:1.5.2:mutationCoverage failed: No mutations found. This probably means there is an issue with either the supplied classpath or filters."

<configuration>
                <targetClasses>
                    <param>com.demoPitsFramework.VerifyisPalindrome*</param>
                </targetClasses>
                <targetTests>
                    <param>com.demoPitsFramework.TestisPalindrome*</param>
                </targetTests>
 </configuration>

The name of my package is demoPitsFramework and class name is VerifyisPalindrome. 
Test class name is TestisPalindrome

Am I writing this correctly?
I really appreciate you helping me !!

Shweta Gupta

SDET

shg...@watermarkinsights.com

www.watermarkinsights.com




Netsmartz Square 

IT-C 9, Sector 67, Chandigarh                                                

https://lh6.googleusercontent.com/JQ_osqAhqqpuT7VL-jE97nBwtZ9-4wvM6P1zZx6v4L7z9C5eLdYrIPGQS9Px3bvW49jN01dfM1aMh061TMcAT3iCwpty855f3-UEB9_fM5f6HkBkXaTJH0MyvDGcq0mv4MHwxUph

We’re excited to announce that EvaluationKIT and Digital Measures have joined the Watermark family. Together, our mission is to put better data into the hands of administrators, faculty, and students everywhere in order to empower them to make meaningful improvements.



On Wed, Jul 8, 2020 at 12:33 AM Ullrich Hafner <ullrich...@gmail.com> wrote:
8:48:47 PM PIT >> INFO : MINION : 8:48:47 PM PIT >> INFO : Found  0 tests


Am 07.07.2020 um 19:48 schrieb Shweta Gupta <shg...@watermarkinsights.com>:

8:48:47 PM PIT >> INFO : MINION : 8:48:47 PM PIT >> INFO : Found  0 tests

<image003.png>

Shweta Gupta

unread,
Jul 7, 2020, 5:34:27 PM7/7/20
to pitu...@googlegroups.com, Ullrich Hafner
Hi,
surefire did pick up my test on `mvn test`. However I converted my tests to Junit tests as they were previously on testng. 
They are now working fine . 
Thank you so very much !! :)

Shweta Gupta

SDET

shg...@watermarkinsights.com

www.watermarkinsights.com

Netsmartz Square 

IT-C 9, Sector 67, Chandigarh                                                

https://lh6.googleusercontent.com/JQ_osqAhqqpuT7VL-jE97nBwtZ9-4wvM6P1zZx6v4L7z9C5eLdYrIPGQS9Px3bvW49jN01dfM1aMh061TMcAT3iCwpty855f3-UEB9_fM5f6HkBkXaTJH0MyvDGcq0mv4MHwxUph

We’re excited to announce that EvaluationKIT and Digital Measures have joined the Watermark family. Together, our mission is to put better data into the hands of administrators, faculty, and students everywhere in order to empower them to make meaningful improvements.


--
You received this message because you are subscribed to a topic in the Google Groups "PIT Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pitusers/Oi69Nw6wIAU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pitusers+u...@googlegroups.com.
image003.png
Reply all
Reply to author
Forward
0 new messages