1

I'm using kotlintest in my projects and I want to run mutation testing with pitest.

Already tried using pitest alone and with junit5 plugin, but the result is always:

Found  0 tests


================================================================================
- Statistics
================================================================================
>> Generated 610 mutations Killed 0 (0%)
>> Ran 0 tests (0 tests per mutation)

I'm using:

  • Pitest - 'info.solidsoft.gradle.pitest:gradle-pitest-plugin:1.4.5'
  • Pitest junit5 - 'org.pitest:pitest-junit5-plugin:0.9'
  • Koltintest - 'io.kotlintest:kotlintest-runner-junit5:3.4.2'

I know kotlintest supports pitest since v3.3.0 (according here) but I don't know how to make it work.

Any ideas how to make it run properly?

Thanks!

1 Answers1

3

I was able to crack it

For reference see "PIT test-plugins support" section in gradle pitest plugin documentation

First you need to set up your buildscript like this:

buildscript {
   repositories {
       mavenCentral()
   }
   configurations.maybeCreate('pitest')
   dependencies {
       classpath 'info.solidsoft.gradle.pitest:gradle-pitest-plugin:1.4.5'
       pitest "io.kotlintest:kotlintest-plugins-pitest:3.4.2"
   }
}

Then you should set PIT plugin name in pitest block

pitest {
    testPlugin = 'KotlinTest'
    // rest of your pitest configuration
}

After that it should work. Hope this helps!

Vantuz
  • 48
  • 6