STAMP-project / pitest-descartes

Descartes supports developers to improve their test suites by reporting weak spots in covered code
https://hal.archives-ouvertes.fr/hal-01870976/document
GNU Lesser General Public License v3.0
126 stars 21 forks source link

Release 1.5 works only if pitest is set to 1.4.7 with gradle plugin #102

Closed pedrovelho closed 5 years ago

pedrovelho commented 5 years ago

Characteristics

Description

Dear Descartes team. Description of new release 1.5 states it works with pitest 1.4.0 for the gradle plugin. I just tested with pitest 1.4.0 and it does not work. This is rather good news because it works with 1.4.7 instead. Solution will be just to update the release note.

Steps to reproduce

Compiling catalog master branch with:

buildscript {
    repositories {
        jcenter()
        mavenCentral()
        maven {
            url "http://repository.activeeon.com/content/groups/proactive/"
        }
        maven {
            url "https://plugins.gradle.org/m2/"
        }
    }

    configurations.maybeCreate("pitest")

    dependencies {
        classpath 'org.springframework.boot:spring-boot-gradle-plugin:1.3.5.RELEASE'
        classpath 'com.diffplug.gradle.spotless:spotless:2.4.0'
        classpath 'org.ow2.proactive:coding-rules:1.0.0'
        classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.5.0'
        classpath "io.spring.gradle:dependency-management-plugin:0.6.0.RELEASE"
        classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.6.1"
        classpath "info.solidsoft.gradle.pitest:gradle-pitest-plugin:1.3.0"
        delete "gradle/ext"
        ant.unjar src: configurations.classpath.find { it.name.startsWith("coding-rules") }, dest: 'gradle/ext'
        pitest 'eu.stamp-project:descartes:1.2.5'
    }
}

apply plugin: 'project-report'
apply plugin: 'spring-boot'
apply plugin: 'com.github.kt3k.coveralls'
apply from: "$rootDir/gradle/ext/coding-format.gradle"
apply plugin: "io.spring.dependency-management"
apply plugin: 'antlr'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'jacoco'
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'war'
apply plugin: 'org.sonarqube'
apply plugin: 'info.solidsoft.pitest'

pitest {
    pitestVersion = "1.4.7"
    targetClasses = ['org.ow2.proactive.catalog.*']
    threads = 2
    outputFormats = ['XML', 'HTML', 'METHODS','ISSUES']
    timestampedReports = false
    testSourceSets = [sourceSets.test]
    mainSourceSets = [sourceSets.main]
    mutationEngine = "descartes"
}

group = 'org.ow2.proactive'

bootRepackage {
    enabled = false
}

configurations {
    // The following module is excluded to avoid clashes when embedded inside the ProActive Scheduler
    all*.exclude module: 'spring-boot-starter-logging'

    integrationTestCompile.extendsFrom testCompile
    integrationTestRuntime.extendsFrom testRuntime

    querydsl

    jacksonCoreLibs
}

compileJava {
    sourceCompatibility = 1.8
    targetCompatibility = 1.8
}

coveralls {
    sourceDirs = allprojects.sourceSets.main.allSource.srcDirs.flatten()
    jacocoReportPath = "${buildDir}/reports/jacoco/test/jacocoTestReport.xml"
}

ext {
    generatedSrcDir = "$projectDir/src/generated/java"
}

generateGrammarSource {
    arguments += ["-visitor", "-long-messages"]
    maxHeapSize = "64m"
    outputDirectory = file("$generatedSrcDir/org/ow2/proactive/catalog/rest/query/parser")
}

repositories {

    if (project.hasProperty('local')) {
        mavenLocal()
    }

    jcenter()
    maven {
        url "http://repository.activeeon.com/content/groups/proactive/"
    }
}

uploadArchives {
    repositories {
        mavenDeployer {
            snapshotRepository(url: "http://repository.activeeon.com/content/repositories/snapshots/") {
                authentication(userName: "${System.getProperty('nexusUsername')}",
                        password: "${System.getProperty('nexusPassword')}")
            }
            repository(url: "http://repository.activeeon.com/content/repositories/releases/") {
                authentication(userName: "${System.getProperty('nexusUsername')}",
                        password: "${System.getProperty('nexusPassword')}")
            }
        }
    }
}

sourceSets {
    generated {
        java {
            srcDirs += generatedSrcDir
        }
    }

    main {
        java {
            srcDirs += generatedSrcDir
        }
    }

    integrationTest {
        java.srcDir file('src/integration-test/java')
        resources.srcDir file('src/integration-test/resources')

        compileClasspath = sourceSets.main.output + configurations.integrationTestCompile
        runtimeClasspath = output + compileClasspath + configurations.integrationTestRuntime
    }
}

springBoot {
    mainClass = 'org.ow2.proactive.catalog.Application'
}

war {
    baseName = "catalog"
    version = version
    classpath configurations.jacksonCoreLibs
}

dependencyManagement {
    imports {
        mavenBom "org.ow2.proactive:parent-bom:${version}"
    }
}

dependencies {
    antlr 'org.antlr:antlr4'

    compile 'org.apache.tika:tika-core:1.18'
    compile 'commons-fileupload:commons-fileupload'
    compile 'org.apache.commons:commons-lang3'
    compile 'com.fasterxml.jackson.core:jackson-databind'
    compile 'com.fasterxml.jackson.core:jackson-core'
    compile 'com.fasterxml.jackson.core:jackson-annotations'
    compile 'com.fasterxml.jackson.datatype:jackson-datatype-joda'
    compile 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310'
    compile 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8'
    compile 'com.fasterxml.jackson.jaxrs:jackson-jaxrs-base'
    compile 'com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider'
    compile 'com.fasterxml.jackson.module:jackson-module-jaxb-annotations'
    compile 'com.fasterxml.jackson.dataformat:jackson-dataformat-cbor'
    compile 'com.mysema.querydsl:querydsl-jpa'

    jacksonCoreLibs 'com.fasterxml.jackson.core:jackson-databind'
    jacksonCoreLibs 'com.fasterxml.jackson.core:jackson-core'
    jacksonCoreLibs 'com.fasterxml.jackson.core:jackson-annotations'
    jacksonCoreLibs 'com.fasterxml.jackson.dataformat:jackson-dataformat-cbor'

    querydsl 'com.mysema.querydsl:querydsl-apt'

    /*
        Spring boot 1.3.X relies on hibernate 4 which is not compatible
        with the version that is used with Scheduling project
     */
    compile 'org.springframework.boot:spring-boot-starter-data-jpa'

    compile 'org.hibernate:hibernate-entitymanager'
    compile 'org.hibernate:hibernate-core'

    compile 'org.springframework.boot:spring-boot-starter-log4j2'
    compile 'org.springframework.boot:spring-boot-starter-web'

    //logger
    compile "org.apache.logging.log4j:log4j-web"

    compile 'org.springframework.hateoas:spring-hateoas'

    compile 'org.eclipse.jetty:jetty-servlets'

    providedCompile 'org.springframework.boot:spring-boot-starter-tomcat'

    providedRuntime 'org.hsqldb:hsqldb'

    compile 'io.springfox:springfox-spring-web'
    compile 'io.springfox:springfox-swagger2'
    compile 'io.springfox:springfox-swagger-ui'

    compile 'com.graphql-java:graphql-java'
    compile 'org.projectlombok:lombok'

    compile 'org.zeroturnaround:zt-zip'

    compile 'com.github.ben-manes.caffeine:caffeine'

    // library to build pdf reports
    compile 'com.github.dhorions:boxable'

    //  Using the Scheduler Rest client as authentication service
    providedCompile "org.ow2.proactive_grid_cloud_portal:rest-client:$version"

    // scheduler-api for parsing workflows
    providedCompile "org.ow2.proactive:scheduler-api:$version"

    testCompile 'com.google.truth:truth'
    testCompile 'junit:junit'
    testCompile 'nl.jqno.equalsverifier:equalsverifier'
    testCompile 'org.mockito:mockito-core'

    integrationTestCompile 'com.google.code.gson:gson'
    integrationTestCompile 'com.jayway.restassured:rest-assured'
    integrationTestCompile 'org.springframework.boot:spring-boot-starter-test'
}

test {
    jacoco {
        destinationFile = file("$buildDir/jacoco/jacocoTest.exec")
    }
}

task integrationTest(type: Test) {
    testClassesDir = sourceSets.integrationTest.output.classesDir
    classpath = sourceSets.integrationTest.runtimeClasspath
    classpath += sourceSets.test.runtimeClasspath

    jacoco {
        destinationFile = file("$buildDir/jacoco/jacocoIntegrationTest.exec")
    }

    testLogging {
        events "passed", "skipped", "failed"
    }
}

task generateQueryDSL(type: JavaCompile, group: 'build', description: 'Generates the QueryDSL query types') {
    // place the output of the QueryDSL predicate processor in a new location.
    def outputDir = file("$generatedSrcDir")
    outputs.dir outputDir
    doFirst {
        // make sure the directory exists.
        outputDir.exists() || outputDir.mkdirs()
    }

    source = sourceSets.main.java
    classpath = configurations.compile + configurations.querydsl

    options.compilerArgs = [
            "-proc:only",
            "-processor", "com.mysema.query.apt.jpa.JPAAnnotationProcessor"
    ]

    // generated code goes into the generated code directory.
    destinationDir = outputDir

    //dependencyCacheDir = compileJava.dependencyCacheDir

}

compileJava.dependsOn generateQueryDSL
compileJava.source generateQueryDSL.outputs.files, sourceSets.main.java

jacocoTestReport {
    executionData test, integrationTest

    sourceSets project.sourceSets.main

    reports {
        html.enabled = true
        xml.enabled = true
    }

    // remove auto-generated classes from report
    afterEvaluate {
        classDirectories = files(classDirectories.files.collect {
            fileTree(dir: it, excludes: [
                    'org/ow2/proactive/catalog/rest/entity/Q*',
                    'org/ow2/proactive/catalog/rest/query/parser/*']);
        })
    }
}

clean {
    sourceSets.generated.java.srcDirs.each {
        srcDir -> delete srcDir
    }
}

task wrapper(type: Wrapper) {
    gradleVersion = '2.10'
}

check.dependsOn integrationTest

jacocoTestReport.dependsOn check
tasks.coveralls.dependsOn jacocoTestReport

tasks.withType(Test) {
    reports.html.destination = file("${reporting.baseDir}/${name}")
}

idea {
    module {
        testSourceDirs += file('src/integration-test/java')
        testSourceDirs += file('src/integration-test/resources')

        scopes.TEST.plus += [
                configurations.integrationTestCompile,
                configurations.integrationTestRuntime
        ]
    }
}

Other files and URLs

Catalog github project

Relationships

Help on issue template

Preview to follow the link or open file .github/ISSUE_DOC.md

oscarlvp commented 5 years ago

Hi @pedrovelho, yes, the latest version is compatible with PITest 1.4.7 and with the Gradle PITest Plugin 1.4.0, actually in the README.md we set pitestVersion = "1.4.7".