Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds testStrengthThreshold config property of PIT 1.6.1 #247

Merged
merged 1 commit into from
Mar 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# gradle-pitest-plugin changelog

## next

- PIT 1.6.1 by default
- support new configuration property `testStrengthThreshold` of PIT 1.6.1

## 1.5.2 - 2020-08-18

- Support java-test-fixtures plugin - [#223](https://github.com/szpak/gradle-pitest-plugin/pull/223) - PR by [Piotr Kubowicz](https://github.com/pkubowicz)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ The Pitest plugin does not need to be additionally configured if you use JUnit 4
```groovy
pitest {
targetClasses = ['our.base.package.*'] //by default "${project.group}.*"
pitestVersion = '1.5.1' //not needed when a default PIT version should be used
pitestVersion = '1.6.1' //not needed when a default PIT version should be used
threads = 4
outputFormats = ['XML', 'HTML']
timestampedReports = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class PitestPlugin implements Plugin<Project> {
public final static String PITEST_TASK_NAME = "pitest"
public final static String PITEST_CONFIGURATION_NAME = 'pitest'

public final static String DEFAULT_PITEST_VERSION = '1.5.2'
public final static String DEFAULT_PITEST_VERSION = '1.6.1'
@Internal
public static final GradleVersion MINIMAL_SUPPORTED_GRADLE_VERSION = GradleVersion.version("5.6") //public as used also in regression tests

Expand Down Expand Up @@ -190,6 +190,7 @@ class PitestPlugin implements Plugin<Project> {
//defaultFileForHistoryData - separate method
task.mutationThreshold.set(extension.mutationThreshold)
task.coverageThreshold.set(extension.coverageThreshold)
task.testStrengthThreshold.set(extension.testStrengthThreshold)
task.mutationEngine.set(extension.mutationEngine)
task.exportLineCoverage.set(extension.exportLineCoverage)
task.jvmPath.set(extension.jvmPath)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ class PitestPluginExtension {
final Property<Boolean> enableDefaultIncrementalAnalysis //specific for Gradle plugin
final Property<Integer> mutationThreshold
final Property<Integer> coverageThreshold
final Property<Integer> testStrengthThreshold
final Property<String> mutationEngine
final Property<Boolean> exportLineCoverage //for debugging usage only
final RegularFileProperty jvmPath
Expand Down Expand Up @@ -256,6 +257,7 @@ class PitestPluginExtension {
enableDefaultIncrementalAnalysis = of.property(Boolean)
mutationThreshold = of.property(Integer)
coverageThreshold = of.property(Integer)
testStrengthThreshold = of.property(Integer)
mutationEngine = of.property(String)
exportLineCoverage = of.property(Boolean)
jvmPath = of.fileProperty()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,10 @@ class PitestTask extends JavaExec {
@Optional
final Property<Integer> coverageThreshold

@Input
@Optional
final Property<Integer> testStrengthThreshold

@Input
@Optional
final Property<String> mutationEngine
Expand Down Expand Up @@ -286,6 +290,7 @@ class PitestTask extends JavaExec {
defaultFileForHistoryData = of.fileProperty()
mutationThreshold = of.property(Integer)
coverageThreshold = of.property(Integer)
testStrengthThreshold = of.property(Integer)
mutationEngine = of.property(String)
exportLineCoverage = of.property(Boolean)
jvmPath = of.fileProperty()
Expand Down Expand Up @@ -373,6 +378,7 @@ class PitestTask extends JavaExec {
map['mutableCodePaths'] = (getMutableCodePaths()*.absolutePath)?.join(',')
map['mutationThreshold'] = optionalPropertyAsString(mutationThreshold)
map['coverageThreshold'] = optionalPropertyAsString(coverageThreshold)
map['testStrengthThreshold'] = optionalPropertyAsString(testStrengthThreshold)
map['mutationEngine'] = mutationEngine.getOrNull()
map['exportLineCoverage'] = optionalPropertyAsString(exportLineCoverage)
map['includeLaunchClasspath'] = Boolean.FALSE.toString() //code to analyse is passed via classPath
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class PitestTaskConfigurationSpec extends BasicProjectBuilderSpec implements Wit
'timestampedReports',
'mutationThreshold',
'coverageThreshold',
'testStrengthThreshold',
'mutationEngine',
'exportLineCoverage',
'jvmPath',
Expand Down Expand Up @@ -164,6 +165,7 @@ class PitestTaskConfigurationSpec extends BasicProjectBuilderSpec implements Wit
//enableDefaultIncrementalAnalysis tested separately
"mutationThreshold" | 90 || "90"
"coverageThreshold" | 95 || "95"
"testStrengthThreshold" | 95 || "95"
"mutationEngine" | "gregor2" || "gregor2"
"exportLineCoverage" | true || "true"
"jvmPath" | new File("//opt//jvm15//") || new File("//opt//jvm15//").path
Expand Down