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

v1.0.6 scoverage.coverage.xml not generated #29

Closed
avdv opened this issue Jan 9, 2015 · 35 comments
Closed

v1.0.6 scoverage.coverage.xml not generated #29

avdv opened this issue Jan 9, 2015 · 35 comments

Comments

@avdv
Copy link

avdv commented Jan 9, 2015

Using version 1.0.6 of the gradle scoverage plugin, there is no xml file generated and the reportScoverage task fails:

:reportScoverage
Exception in thread "main" java.io.FileNotFoundException: /src/project/build/scoverage/scoverage.coverage.xml (No such file or directory)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(FileInputStream.java:146)
    at scala.io.Source$.fromFile(Source.scala:91)
    at scala.io.Source$.fromFile(Source.scala:76)
    at scoverage.Serializer$.deserialize(Serializer.scala:118)
    at scoverage.Serializer.deserialize(Serializer.scala)
    at org.scoverage.ScoverageReport.main(ScoverageReport.java:30)

When using version 1.0-5-g9c68988 it works.

@Kwestor
Copy link
Contributor

Kwestor commented Jan 9, 2015

You need to run testScoverage first. But the message could be improved to tell you this.

@avdv
Copy link
Author

avdv commented Jan 9, 2015

Note, I've used org.scoverage:scalac-scoverage-plugin_2.11:1.0.2 for both runs. And also ran the clean task before calling reportScoverage.

Seems the testScoverage task should declare its outputs, since it is always regarded as UP-TO-DATE after the first run, even when removing the build/scoverage directory.

But, even after specifying

testScoverage.outputs.file "${buildDir}/scoverage/scoverage.coverage.xml"

in my build script, the task is not run:

$ rm -rf build/scoverage
$ ./gradlew testScoverage
...
:testClasses UP-TO-DATE
:testScoverage UP-TO-DATE

Why doesn't Gradle run the task when an output is missing?

But, even when I'm forcing to run the task more explicitely:

testScoverage.outputs.upToDateWhen { file("${buildDir}/scoverage/scoverage.coverage.xml").exists() }

The task runs but the xml file is not created:

$ rm -rf build/scoverage
$ ./gradlew testScoverage
...
:processTestResources UP-TO-DATE
:testClasses UP-TO-DATE
:testScoverage

BUILD SUCCESSFUL
$ ls build/scoverage -1
scoverage.measurements.112
scoverage.measurements.130
scoverage.measurements.16
scoverage.measurements.37
scoverage.measurements.56
scoverage.measurements.74
scoverage.measurements.76
scoverage.measurements.83

What gives?

@avdv
Copy link
Author

avdv commented Jan 9, 2015

Oh, the XML file is not generated by testScoverage, but by compileScoverageScala.

Still, this file is not generated with version 1.0.6. And it is not re-generated when the file is missing (for 1.0.5).

\edit: workaround to force re-generation of the scoverage.coverage.xml file if it is missing:

compileScoverageScala {
  def coverageXml = file("${buildDir}/scoverage/scoverage.coverage.xml")
  outputs.file coverageXml

  doFirst {
    if (!coverageXml.exists()) delete outputs
  }
}

@SinghAsDev
Copy link

I am hitting the same issue. I am using "org.scoverage:scalac-scoverage-plugin_2.10:1.0.2".

Even after running testScoverage, with force run of compileScoverageScala, successfully, I am not getting any scoverage.coverage.xml.

[asingh@asingh-MBP:~/ClouderaOffice/Apache/kafka]$find . -name "*coverage*"
./build/reports/scoverage
./build/scoverage
./core/build/classes/scoverage
./core/build/test-results/binary/testScoverage
./core/build/tmp/scala/compilerAnalysis/compileScoverageScala.analysis
./core/build/tmp/scala/compilerAnalysis/compileScoverageScala.analysis.relations
./core/build/tmp/testScoverage

1.0-5-g9c68988 works, but throws NPE for AnonymousFunction. :(

@maiflai
Copy link
Contributor

maiflai commented Jan 10, 2015

Hi all,

scoverage.coverage.xml is indeed generated by the compileScoverageScala task - it contains details of the statements that will be measured.

As a workaround to ensure a manually deleted file is detected (this will be fixed), I think you strictly only require this:

compileScoverageScala {
  outputs.file("${buildDir}/scoverage/scoverage.coverage.xml")
}

In my testing (and as per the documentation) gradle detects that the file is missing, and re-runs the compilation task. It then runs the test and/or report task as requested.

@SinghAsDev -https://groups.google.com/forum/#!topic/scala-code-coverage-tool/RTwYt4FyqSE suggests that scoverage doesn't work at all with 2.10, I'm not sure why a 2.10 package of 1.0.2 has been released. Is there any way you can re-test with 2.11? If not, please could you edit your comment to include the stacktrace of the NPE?

@avdv - I think an early incarnation of the plugin used to skip the report task if there were no measured statements, but this was removed in favour of failing the build - there is no report to show if there are no measured statements. Please could you post a sample build file using 1.0.6 that demonstrates the issue? I'm unable to reproduce it with the following simple build (and a single scala source file).

--edit please could you send it with the text output of a --debug run?

I can reproduce the issue with an empty source directory; this doesn't create a measurement file at all.

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'org.scoverage:gradle-scoverage:1.0.6'
    }
}

apply plugin: 'scala'
apply plugin: 'scoverage'

repositories {
    mavenCentral()
}
dependencies {

    scoverage 'org.scoverage:scalac-scoverage-plugin_2.11:1.0.2',
            'org.scoverage:scalac-scoverage-runtime_2.11:1.0.2'


    compile "org.scala-lang:scala-library:2.11.4"

}

@SinghAsDev
Copy link

@maiflai I do not get any coverage.xml with 2.11. I am using sonar-scoverage-plugin-1.1.0, gradle-scoverage:1.0.6 and SonarQube 4.2.

I am trying to make coverage work for Apache Kafka, below id the modified build.gradle file. I ran ./gradlew :core:clean :core:testScoverage --stacktrace -PscalaVersion=2.11 --info. You can look at project structure of Kafka at https://github.com/apache/kafka.

// Licensed to the Apache Software Foundation (ASF) under one or more
// contributor license agreements.  See the NOTICE file distributed with
// this work for additional information regarding copyright ownership.
// The ASF licenses this file to You under the Apache License, Version 2.0
// (the "License"); you may not use this file except in compliance with
// the License.  You may obtain a copy of the License at
// 
//    http://www.apache.org/licenses/LICENSE-2.0
// 
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

buildscript {
  repositories {
    mavenCentral()
  }
  dependencies {
    classpath 'org.scoverage:gradle-scoverage:1.0.6'
  }
  apply from: file('gradle/buildscript.gradle'), to: buildscript
}

def slf4jlog4j='org.slf4j:slf4j-log4j12:1.7.6'

allprojects {
  apply plugin: 'idea'

  repositories {
    mavenCentral()
  }
}

apply plugin: 'sonar-runner'

ext {
    gradleVersion = "2.0"
}

def isVerificationRequired(project) {
    project.gradle.startParameter.taskNames.any { it.contains("upload") }
}

apply from: file('wrapper.gradle')
apply from: file('gradle/license.gradle')
apply from: file('scala.gradle')

subprojects {
  apply plugin: 'java'
  apply plugin: 'eclipse'
  apply plugin: 'maven'
  apply plugin: 'signing'

  licenseTest.onlyIf { isVerificationRequired(project) }

  uploadArchives {
    repositories {
      signing {
          if (isVerificationRequired(project)) {
              sign configurations.archives

              // To test locally, replace mavenUrl in ~/.gradle/gradle.properties to file://localhost/tmp/myRepo/
              mavenDeployer {
                  beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
                  repository(url: "${mavenUrl}") {
                      authentication(userName: "${mavenUsername}", password: "${mavenPassword}")
                  }
                  afterEvaluate {
                      pom.artifactId = "${archivesBaseName}"
                      pom.project {
                          name 'Apache Kafka'
                          packaging 'jar'
                          url 'http://kafka.apache.org'
                          licenses {
                              license {
                                  name 'The Apache Software License, Version 2.0'
                                  url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
                                  distribution 'repo'
                              }
                          }
                      }
                  }
              }
          }
      }
    }
  }

  jar {
    from '../LICENSE'
    from '../NOTICE'
  }

  task srcJar(type:Jar) {
    classifier = 'sources'
    from '../LICENSE'
    from '../NOTICE'
    from sourceSets.main.java
  }

  task javadocJar(type: Jar, dependsOn: javadoc) {
    classifier 'javadoc'
    from '../LICENSE'
    from '../NOTICE'
    from javadoc.destinationDir
  }

  task docsJar(dependsOn: javadocJar)

  artifacts {
    archives srcJar
    archives javadocJar
  }

  plugins.withType(ScalaPlugin) {
    //source jar should also contain scala source:
    srcJar.from sourceSets.main.scala

    task scaladocJar(type:Jar) {
      classifier = 'scaladoc'
      from '../LICENSE'
      from '../NOTICE'
      from scaladoc
    }

    //documentation task should also trigger building scala doc jar
    docsJar.dependsOn scaladocJar

    artifacts {
      archives scaladocJar
    }
  }

  tasks.withType(ScalaCompile) {
    scalaCompileOptions.useAnt = false

    configure(scalaCompileOptions.forkOptions) {
      memoryMaximumSize = '1g'
      jvmArgs = ['-XX:MaxPermSize=512m']
    }
  }
}

for ( sv in ['2_9_1', '2_9_2', '2_10_4', '2_11'] ) {
  String svInDot = sv.replaceAll( "_", ".")

  tasks.create(name: "jar_core_${sv}", type: GradleBuild) {
    buildFile = './build.gradle'
    tasks = ['core:jar']
    startParameter.projectProperties = [scalaVersion: "${svInDot}"]
  }

  tasks.create(name: "test_core_${sv}", type: GradleBuild) {
    buildFile = './build.gradle'
    tasks = ['core:test']
    startParameter.projectProperties = [scalaVersion: "${svInDot}"]
  }

  tasks.create(name: "srcJar_${sv}", type: GradleBuild) {
    buildFile = './build.gradle'
    tasks = ['core:srcJar']
    startParameter.projectProperties = [scalaVersion: "${svInDot}"]
  }

  tasks.create(name: "docsJar_${sv}", type: GradleBuild) {
    buildFile = './build.gradle'
    tasks = ['core:docsJar']
    startParameter.projectProperties = [scalaVersion: "${svInDot}"]
  }

  tasks.create(name: "releaseTarGz_${sv}", type: GradleBuild) {
    buildFile = './build.gradle'
    tasks = ['releaseTarGz']
    startParameter.projectProperties = [scalaVersion: "${svInDot}"]
  }

  tasks.create(name: "uploadCoreArchives_${sv}", type: GradleBuild) {
    buildFile = './build.gradle'
    tasks = ['core:uploadArchives']
    startParameter.projectProperties = [scalaVersion: "${svInDot}"]
  }
}

tasks.create(name: "jarAll", dependsOn: ['jar_core_2_9_1', 'jar_core_2_9_2', 'jar_core_2_10_4', 'jar_core_2_11', 'clients:jar', 'examples:jar', 'contrib:hadoop-consumer:jar', 'contrib:hadoop-producer:jar']) {
}

tasks.create(name: "srcJarAll", dependsOn: ['srcJar_2_9_1', 'srcJar_2_9_2', 'srcJar_2_10_4', 'srcJar_2_11', 'clients:srcJar', 'examples:srcJar', 'contrib:hadoop-consumer:srcJar', 'contrib:hadoop-producer:srcJar']) { }

tasks.create(name: "docsJarAll", dependsOn: ['docsJar_2_9_1', 'docsJar_2_9_2', 'docsJar_2_10_4', 'docsJar_2_11', 'clients:docsJar', 'examples:docsJar', 'contrib:hadoop-consumer:docsJar', 'contrib:hadoop-producer:docsJar']) { }

tasks.create(name: "testAll", dependsOn: ['test_core_2_9_1', 'test_core_2_9_2', 'test_core_2_10_4', 'test_core_2_11', 'clients:test']) {
}

tasks.create(name: "releaseTarGzAll", dependsOn: ['releaseTarGz_2_9_1', 'releaseTarGz_2_9_2', 'releaseTarGz_2_10_4', 'releaseTarGz_2_11']) {
}

tasks.create(name: "uploadArchivesAll", dependsOn: ['uploadCoreArchives_2_9_1', 'uploadCoreArchives_2_9_2', 'uploadCoreArchives_2_10_4', 'uploadCoreArchives_2_11', 'clients:uploadArchives', 'examples:uploadArchives', 'contrib:hadoop-consumer:uploadArchives', 'contrib:hadoop-producer:uploadArchives']) {
}

project(':core') {
  println "Building project 'core' with Scala version $scalaVersion"

  apply plugin: 'scoverage'
  testScoverage.outputs.file "${buildDir}/scoverage/scoverage.coverage.xml"
  compileScoverageScala {
    outputs.file("${buildDir}/scoverage/scoverage.coverage.xml")
  }
  //reportScoverage {
  //  dependencies {
  //    classpath 'org.scoverage:gradle-scoverage:1.0.6'
  //  }
  //}

  apply plugin: 'scala'
  archivesBaseName = "kafka_${baseScalaVersion}"

  def (major, minor, trivial) = scalaVersion.tokenize('.')

  dependencies {
    compile project(':clients')
    compile "org.scala-lang:scala-library:$scalaVersion"
    compile 'org.apache.zookeeper:zookeeper:3.4.6'
    compile 'com.101tec:zkclient:0.3'
    compile 'com.yammer.metrics:metrics-core:2.2.0'
    compile 'net.sf.jopt-simple:jopt-simple:3.2'

    testCompile 'junit:junit:4.1'
    testCompile 'org.easymock:easymock:3.0'
    testCompile 'org.objenesis:objenesis:1.2'
    testCompile project(':clients')
    if (scalaVersion.startsWith('2.10')) {
      testCompile 'org.scalatest:scalatest_2.10:1.9.1'
    } else if (scalaVersion.startsWith('2.11')) {
      compile 'org.scala-lang.modules:scala-xml_2.11:1.0.2'
      compile 'org.scala-lang.modules:scala-parser-combinators_2.11:1.0.2'
      testCompile "org.scalatest:scalatest_2.11:2.2.0"
    } else {
      testCompile "org.scalatest:scalatest_$scalaVersion:1.8"
    }
    testRuntime "$slf4jlog4j"

    zinc 'com.typesafe.zinc:zinc:0.3.1'

    if (scalaVersion.startsWith('2.10')) {
      scoverage 'org.scoverage:scalac-scoverage-plugin_2.10:1.0.2'
      scoverage 'org.scoverage:scalac-scoverage-runtime_2.10:1.0.2'
    } else if (scalaVersion.startsWith('2.11')) {
      scoverage 'org.scoverage:scalac-scoverage-plugin_2.11:1.0.2'
      scoverage 'org.scoverage:scalac-scoverage-runtime_2.11:1.0.2'
    }
  }
  configurations {
    // manually excludes some unnecessary dependencies
    compile.exclude module: 'javax'
    compile.exclude module: 'jline'
    compile.exclude module: 'jms'
    compile.exclude module: 'jmxri'
    compile.exclude module: 'jmxtools'
    compile.exclude module: 'mail'
    compile.exclude module: 'netty'
  }

  tasks.create(name: "copyDependantLibs", type: Copy) {
    from (configurations.testRuntime) {
      include('slf4j-log4j12*')
    }
    from (configurations.runtime) {
      exclude('kafka-clients*')
    }
    into "$buildDir/dependant-libs-${scalaVersion}"
  }

  tasks.create(name: "releaseTarGz", dependsOn: configurations.archives.artifacts, type: Tar) { 
    into "kafka_${baseScalaVersion}-${version}"
    compression = Compression.GZIP 
    from(project.file("../bin")) { into "bin/" }
    from(project.file("../config")) { into "config/" }
    from '../LICENSE'
    from '../NOTICE'
    from(configurations.runtime) { into("libs/") }
    from(configurations.archives.artifacts.files) { into("libs/") }
  }

  jar {
    dependsOn 'copyDependantLibs'
  }

  jar.manifest {
    attributes(
      'Version': "${version}"
    )
  }

  task testJar(type: Jar) {
    classifier = 'test'
    from sourceSets.test.output
  }

  test {
    testLogging {
        events "passed", "skipped", "failed"
        exceptionFormat = 'full'
    }
  }

  artifacts {
    archives testJar
  }

  sonarRunner {
    sonarProperties {
      property "sonar.language", "scala"
      property "sonar.scoverage.reportPath", "${buildDir}/scoverage/scoverage.coverage.xml"
    }
  }
}

project(':contrib:hadoop-consumer') {
  archivesBaseName = "kafka-hadoop-consumer"

  dependencies {
    compile project(':core')
    compile "org.apache.avro:avro:1.4.0"
    compile "org.apache.pig:pig:0.8.0"
    compile "commons-logging:commons-logging:1.0.4"
    compile "org.codehaus.jackson:jackson-core-asl:1.5.5"
    compile "org.codehaus.jackson:jackson-mapper-asl:1.5.5"
    compile "org.apache.hadoop:hadoop-core:0.20.2"
  }

  configurations {
    // manually excludes some unnecessary dependencies
    compile.exclude module: 'javax'
    compile.exclude module: 'jms'
    compile.exclude module: 'jmxri'
    compile.exclude module: 'jmxtools'
    compile.exclude module: 'mail'
    compile.exclude module: 'netty'
  }

  sonarRunner {
    skipProject = true
  }
}

project(':contrib:hadoop-producer') {
  archivesBaseName = "kafka-hadoop-producer"

  dependencies {
    compile project(':core')
    compile("org.apache.avro:avro:1.4.0") { force = true }
    compile "org.apache.pig:pig:0.8.0"
    compile "commons-logging:commons-logging:1.0.4"
    compile "org.codehaus.jackson:jackson-core-asl:1.5.5"
    compile "org.codehaus.jackson:jackson-mapper-asl:1.5.5"
    compile "org.apache.hadoop:hadoop-core:0.20.2"
    compile "org.apache.pig:piggybank:0.12.0"
  }

  configurations {
    // manually excludes some unnecessary dependencies
    compile.exclude module: 'javax'
    compile.exclude module: 'jms'
    compile.exclude module: 'jmxri'
    compile.exclude module: 'jmxtools'
    compile.exclude module: 'mail'
    compile.exclude module: 'netty'
  }

  sonarRunner {
    skipProject = true
  }
}

project(':examples') {
  archivesBaseName = "kafka-examples"

  dependencies {
    compile project(':core')
  }

  sonarRunner {
    skipProject = true
  }
}

project(':clients') {
  archivesBaseName = "kafka-clients"

  dependencies {
    compile "org.slf4j:slf4j-api:1.7.6"
    compile 'org.xerial.snappy:snappy-java:1.1.1.6'
    compile 'net.jpountz.lz4:lz4:1.2.0'

    testCompile 'com.novocode:junit-interface:0.9'
    testRuntime "$slf4jlog4j"
  }

  task testJar(type: Jar) {
    classifier = 'test'
    from sourceSets.test.output
  }

  test {
    testLogging {
        events "passed", "skipped", "failed"
        exceptionFormat = 'full'
    }
  }

  javadoc {
    include "**/org/apache/kafka/clients/producer/*"
    include "**/org/apache/kafka/common/errors/*"
  }

  apply plugin: "jacoco"

  sonarRunner {
    sonarProperties {
      property "sonar.language", "java"
    }
  }

}

After successfully running testScoverage, there is no coverage.xml generated.

$find . -name "*coverage*"
./build/reports/scoverage
./build/scoverage
./core/build/classes/scoverage
./core/build/test-results/binary/testScoverage
./core/build/tmp/scala/compilerAnalysis/compileScoverageScala.analysis
./core/build/tmp/scala/compilerAnalysis/compileScoverageScala.analysis.relations
./core/build/tmp/testScoverage

@avdv
Copy link
Author

avdv commented Jan 10, 2015

As a workaround to ensure a manually deleted file is detected (this will be fixed), I think you strictly only require this:

compileScoverageScala {
outputs.file("${buildDir}/scoverage/scoverage.coverage.xml")
}

That doesn't work when you're using the incremental zinc compiler, as the compiler will not recompile anything without the source files being changed.

--edit please could you send it with the text output of a --debug run?

I'll do when I'm back to work on monday.

@maiflai
Copy link
Contributor

maiflai commented Jan 11, 2015

-- summary: I'll prepare a release later today.

@avdv - thanks, I see what you mean - the scoverage compiler plugin only writes statement data for the files that were instrumented in the current run, therefore you cannot use incremental building as it forgets everything but the most recently compiled.

I think the gradle scala plugin page suggests that it's better to use the Ant compiler if incremental building is not possible. I'm not sure I feel comfortable forcing the Ant compiler when compiling measured code, so I suppose the best thing to do is protect users by removing any previous compiled code. It seems there is an explicit option for this: scalaCompileOptions.force = 'changed', but the gradle source code suggests that it is currently ignored. This leaves us with deleting the output directory, as you suggest.

@SinghAsDev - the issue here is that the gradle wrappers for Ant and Zinc behave in different ways. A change released in gradle-scoverage 1.0.6 handled an issue when using the Ant compiler with long paths. Unfortunately this introduced a bug when using the Zinc compiler.

I've now added tests for both Ant and Zinc, but the Kafka build still fails, but now with a nasty internal compiler error. Please could you confirm that the stacktrace in question contains the following:

Caused by: java.lang.NullPointerException
  at scala.tools.nsc.backend.icode.GenICode$ICodePhase$Context.exitScope(GenICode.scala:1914)

I think this particular issue will require closer analysis from the scalac-scoverage developers. There are several standard scalac warnings that are produced, and then warnings from the scoverage plugin. The next release should help you to prepare a bug report for them.

@maiflai
Copy link
Contributor

maiflai commented Jan 11, 2015

@SinghAsDev - I think that if you use gradle-scoverage 1.0-5-g9c68988 and exclude kafka.utils you may get a build that works. The search can be narrowed further with the excludedFiles option.

apply plugin: 'scoverage'
  scoverage {
    excludedPackages = [
      'kafka.utils'
    ]
  }

@avdv
Copy link
Author

avdv commented Jan 11, 2015

A change released in gradle-scoverage 1.0.6 handled an issue when using the Ant compiler with long paths

You are referring to commit a8a19c7, right?

IMO, that change is questionable. If the ant compiler really has problems with spaces and does not properly escape then it is a gradle bug. I've seen this kind of patch way too often and it is never a good idea. First and foremost, you blindly enclose any parameter in double quotes, even those that already contain double quotes. Depending on which component is processing the quotes, this might or might not work. How about reverting that commit and fixing the problem at the root of the matter?

@SinghAsDev
Copy link

@maiflai thanks for taking a look at the issue.

I think that if you use gradle-scoverage 1.0-5-g9c68988 and exclude kafka.utils you may get a build that works. The search can be narrowed further with the excludedFiles option.

I have already tried this. The actual file that needs to be excluded is ZkUtils. However, with that I run into another issue, RadoBuransky/sonar-scoverage-plugin#10, for which I have been suggested to use gradle-scoverage 1.0.6.

@maiflai
Copy link
Contributor

maiflai commented Jan 11, 2015

@avdv - yes, i can't fault your logic. My short-term view was that the change to the main gradle build will take some time to trickle through their release process, and if not carefully handled will break backwards-compatibility with other consumers. In the process of implementing a short-term hack, I managed to break the other compiler. As detailed in the Issue report behind that commit, I plan to submit a PR to the gradle team, but this will take a bit longer to do properly. I suspect I'll need another PR to look at the incremental build options.

@SinghAsDev - I don't think the gradle scoverage (or SCCT) plugin has ever published the scoverage xml output file; it only publishes cobertura and HTML outputs. I suggest that you might try a sonar cobertura plugin in the meantime?

@SinghAsDev
Copy link

@maiflai even if I try using 1.0-5-g9c68988 to get coverage.xml, reportScoverage fails with

Caused by: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1

The ST, below, is not that helpful. Any suggestion to get around this?

20:09:24.965 [ERROR] [org.gradle.BuildExceptionReporter] * Exception is:
20:09:24.966 [ERROR] [org.gradle.BuildExceptionReporter] org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':core:reportScoverage'.
20:09:24.966 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
20:09:24.967 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
20:09:24.967 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
20:09:24.967 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
20:09:24.968 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
20:09:24.968 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:42)
20:09:24.968 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
20:09:24.969 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
20:09:24.969 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
20:09:24.969 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:296)
20:09:24.969 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.executeTask(AbstractTaskPlanExecutor.java:79)
20:09:24.970 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:63)
20:09:24.970 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:51)
20:09:24.971 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:23)
20:09:24.971 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:86)
20:09:24.971 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:29)
20:09:24.972 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
20:09:24.972 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
20:09:24.972 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:67)
20:09:24.973 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
20:09:24.973 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
20:09:24.973 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:54)
20:09:24.974 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:148)
20:09:24.974 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:105)
20:09:24.974 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:85)
20:09:24.975 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:81)
20:09:24.975 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33)
20:09:24.975 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24)
20:09:24.976 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:39)
20:09:24.976 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:45)
20:09:24.976 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
20:09:24.976 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
20:09:24.977 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:35)
20:09:24.977 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
20:09:24.977 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:24)
20:09:24.978 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
20:09:24.978 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.daemon.server.exec.StartStopIfBuildAndStop.execute(StartStopIfBuildAndStop.java:33)
20:09:24.978 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
20:09:24.979 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.daemon.server.exec.ReturnResult.execute(ReturnResult.java:34)
20:09:24.979 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
20:09:24.980 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:71)
20:09:24.980 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:69)
20:09:24.980 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.util.Swapper.swap(Swapper.java:38)
20:09:24.981 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:69)
20:09:24.981 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
20:09:24.981 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60)
20:09:24.982 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
20:09:24.982 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
20:09:24.982 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:60)
20:09:24.983 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
20:09:24.983 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
20:09:24.983 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:45)
20:09:24.984 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.daemon.server.DaemonStateCoordinator.runCommand(DaemonStateCoordinator.java:184)
20:09:24.984 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy.doBuild(StartBuildOrRespondWithBusy.java:49)
20:09:24.984 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
20:09:24.985 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
20:09:24.985 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.daemon.server.exec.HandleStop.execute(HandleStop.java:30)
20:09:24.985 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
20:09:24.986 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.daemon.server.exec.DaemonHygieneAction.execute(DaemonHygieneAction.java:39)
20:09:24.986 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
20:09:24.986 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.daemon.server.exec.CatchAndForwardDaemonFailure.execute(CatchAndForwardDaemonFailure.java:32)
20:09:24.986 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
20:09:24.987 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.daemon.server.exec.DefaultDaemonCommandExecuter.executeCommand(DefaultDaemonCommandExecuter.java:51)
20:09:24.987 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.daemon.server.DefaultIncomingConnectionHandler$ConnectionWorker.handleCommand(DefaultIncomingConnectionHandler.java:155)
20:09:24.987 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.daemon.server.DefaultIncomingConnectionHandler$ConnectionWorker.receiveAndHandleCommand(DefaultIncomingConnectionHandler.java:128)
20:09:24.988 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.daemon.server.DefaultIncomingConnectionHandler$ConnectionWorker.run(DefaultIncomingConnectionHandler.java:116)
20:09:24.988 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:64)
20:09:24.989 [ERROR] [org.gradle.BuildExceptionReporter]    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
20:09:24.989 [ERROR] [org.gradle.BuildExceptionReporter]    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
20:09:24.990 [ERROR] [org.gradle.BuildExceptionReporter]    at java.lang.Thread.run(Thread.java:745)
20:09:24.990 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1
20:09:24.990 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.process.internal.DefaultExecHandle$ExecResultImpl.assertNormalExitValue(DefaultExecHandle.java:365)
20:09:24.991 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.process.internal.DefaultJavaExecAction.execute(DefaultJavaExecAction.java:31)
20:09:24.991 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.tasks.JavaExec.exec(JavaExec.java:60)
20:09:24.991 [ERROR] [org.gradle.BuildExceptionReporter]    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
20:09:24.992 [ERROR] [org.gradle.BuildExceptionReporter]    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
20:09:24.992 [ERROR] [org.gradle.BuildExceptionReporter]    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
20:09:24.993 [ERROR] [org.gradle.BuildExceptionReporter]    at java.lang.reflect.Method.invoke(Method.java:606)
20:09:24.993 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:63)
20:09:24.993 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:218)
20:09:24.994 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:211)
20:09:24.994 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:200)
20:09:24.995 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:570)
20:09:24.995 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:553)
20:09:24.995 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
20:09:24.996 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
20:09:24.996 [ERROR] [org.gradle.BuildExceptionReporter]    ... 69 more

This is all I get with --full-stacktrace.

@SinghAsDev
Copy link

@maiflai did you happen to take a look at this?

@maiflai
Copy link
Contributor

maiflai commented Jan 13, 2015

Sorry, not yet - can you provide the command line arguments for the failing java process? Can you run the build in --debug mode, find them in the output and paste them here?

@maiflai
Copy link
Contributor

maiflai commented Jan 13, 2015

@avdv, @SinghAsDev - I think that we currently have two working versions that are released to maven central.

  • 1.0-5-g9c68988 works with the Zinc compiler, if you configure the compilation task to always clean its output directory.
  • 1.0.6 works with the current Ant compiler, unless you manually configure arguments with quotes in them.

With that in mind, I plane to update the README to inform users, and I'll work on getting consistent fixes into the upstream gradle build.

Once a new gradle build has been published, I can release a new version of the plugin which doesn't have the hacked workarounds.

If a pressing feature-request arrives before gradle is fixed, then we'll have to review the hacks and probably add a further one so that both Ant and Zinc are supported by a single version of the plugin. I don't plan on maintaining branches.

Does this sound reasonable?

@SinghAsDev
Copy link

@maiflai below are the arguments

Starting process 'command '/Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home/bin/java''. Working directory: /Users/asingh/ClouderaOffice/Apache/kafka/core Command: /Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home/bin/java -Dfile.encoding=US-ASCII -cp /Users/asingh/.gradle/caches/modules-2/files-2.1/org.scoverage/scalac-scoverage-plugin_2.11/1.0.2/5ceeec2f979105f59a4779af8e4c9e671ce0b6af/scalac-scoverage-plugin_2.11-1.0.2.jar:/Users/asingh/.gradle/caches/modules-2/files-2.1/org.scoverage/scalac-scoverage-runtime_2.11/1.0.2/12a057b57a102ceb621f2f23a9bcc475836536/scalac-scoverage-runtime_2.11-1.0.2.jar:/Users/asingh/.gradle/caches/modules-2/files-2.1/org.scala-lang/scala-library/2.11.4/734ac63e470706015ea786f7780c80db49f001a4/scala-library-2.11.4.jar:/Users/asingh/.gradle/caches/modules-2/files-2.1/org.scala-lang.modules/scala-xml_2.11/1.0.1/21dbac0088b91b8ffb7ac385301f4340f8ebe71f/scala-xml_2.11-1.0.1.jar org.scoverage.ScoverageReport /Users/asingh/ClouderaOffice/Apache/kafka/core/src/main/scala /Users/asingh/ClouderaOffice/Apache/kafka/core/build/scoverage /Users/asingh/ClouderaOffice/Apache/kafka/core/build/reports/scoverage

@maiflai
Copy link
Contributor

maiflai commented Jan 14, 2015

thanks - I think you've run into #13 here.

can you try adding:

reportScoverage {
  dependencies {
    scoverage 'org.scoverage:gradle-scoverage:1.0-5-g9c68988'
  }
}

As per the link I plan to resolve this by pushing the reporting code up into the scalac-scoverage project.

@SinghAsDev
Copy link

@maiflai its already there in my build.gradle.

@avdv
Copy link
Author

avdv commented Jan 16, 2015

With that in mind, I plane to update the README to inform users, and I'll work on getting consistent fixes into the upstream gradle build.

Once a new gradle build has been published, I can release a new version of the plugin which doesn't have the hacked workarounds.

If a pressing feature-request arrives before gradle is fixed, then we'll have to review the hacks and probably add a further one so that both Ant and Zinc are supported by a single version of the plugin. I don't plan on maintaining branches.

Does this sound reasonable?

👍 sounds good.

@SinghAsDev
Copy link

@maiflai sorry to bug you again on this, but did you happen to take a look at the reportScoverage issue? Should I create a separate issue for it?

@maiflai
Copy link
Contributor

maiflai commented Jan 18, 2015

I don't see a gradle-scoverage jar in the classpath there, so I do think it's a duplicate of #13.

I think it's just more complicated because the kafka build targets multiple scala versions. Have you discussed adding this feature with the kafka team? Do you plan to submit a PR to them? If you do plan on doing this, it may be helpful for you to fork their repository and then I can help you there.

I've been able to get this working locally, but I need to see your changes in the whole to understand the missing pieces.

Executing task ':core:reportScoverage' (up-to-date check took 0.006 secs) due to:
  No history is available.
Starting process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_11.jdk/Contents/Home/bin/java''. Working directory: /Users/stu/Documents/Eclipse/kafka/core Command: /Library/Java/JavaVirtualMachines/jdk1.8.0_11.jdk/Contents/Home/bin/java -Dfile.encoding=UTF-8 -cp /Users/stu/.gradle/caches/modules-2/files-2.1/org.scoverage/gradle-scoverage/1.0-5-g9c68988/19bd553df3d6ced75d56b9912a10672af896ba9e/gradle-scoverage-1.0-5-g9c68988.jar:/Users/stu/.gradle/caches/modules-2/files-2.1/org.scoverage/scalac-scoverage-plugin_2.11/1.0.2/5ceeec2f979105f59a4779af8e4c9e671ce0b6af/scalac-scoverage-plugin_2.11-1.0.2.jar:/Users/stu/.gradle/caches/modules-2/files-2.1/org.scoverage/scalac-scoverage-runtime_2.11/1.0.2/12a057b57a102ceb621f2f23a9bcc475836536/scalac-scoverage-runtime_2.11-1.0.2.jar:/Users/stu/.gradle/caches/modules-2/files-2.1/org.scala-lang/scala-library/2.11.4/734ac63e470706015ea786f7780c80db49f001a4/scala-library-2.11.4.jar:/Users/stu/.gradle/caches/modules-2/files-2.1/org.scala-lang.modules/scala-xml_2.11/1.0.1/21dbac0088b91b8ffb7ac385301f4340f8ebe71f/scala-xml_2.11-1.0.1.jar org.scoverage.ScoverageReport /Users/stu/Documents/Eclipse/kafka/core/src/main/scala /Users/stu/Documents/Eclipse/kafka/core/build/scoverage /Users/stu/Documents/Eclipse/kafka/core/build/reports/scoverage
Successfully started process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_11.jdk/Contents/Home/bin/java''
:core:reportScoverage (Thread[Daemon,5,main]) completed. Took 8.321 secs.

@SinghAsDev
Copy link

@maiflai I was able to get reportScoverage working. As you pointed out earlier, it was not getting gradle-scoverage in its classpath. Thanks for your help. I have one more question though. Is it possible to use sonarQube to display coverage using the cobertura report generated by scoverage? For some reason even after parsing the cobertura report, sonar is not reporting code coverage.

@SinghAsDev
Copy link

Just noticed that cobertura.xml generated by gradle-scoverage just has summary of coverage. Is there any plan on making gradle-scoverage work with sonar-scoverage-plugin?

@maiflai
Copy link
Contributor

maiflai commented Jan 18, 2015

Yes, I plan to publish the scoverage format in addition to the cobertura and html formats.

@SinghAsDev
Copy link

Nice! Any estimate on by when will that be available?

@maiflai
Copy link
Contributor

maiflai commented Jan 18, 2015

Sorry, there's a bit of a backlog and I think I prefer the functionality to be in a PR to scalac-scoverage (upstream).

The summary coverage should be interesting in the meantime? And you can always review the HTML coverage outside of sonar.

@sksamuel
Copy link
Member

The report writers are in the scala-scoverage package. What is it you want
in there in addition? You can make an issue if you want and I can add them.

On 18 January 2015 at 21:07, maiflai [email protected] wrote:

Sorry, there's a bit of a backlog and I think I prefer the functionality
to be in a PR to scalac-scoverage (upstream).

The summary coverage should be interesting in the meantime? And you can
always review the HTML coverage outside of sonar.


Reply to this email directly or view it on GitHub
#29 (comment)
.

@maiflai
Copy link
Contributor

maiflai commented Jan 18, 2015

Cheers - yes, we're already using some of the classes directly but I think a CLI would help to simplify our consumption. I've raised scoverage/scalac-scoverage-plugin#81 - can we talk about it there?

@maiflai
Copy link
Contributor

maiflai commented Feb 8, 2015

I've published 1.0.8, which now produces the scoverage xml file as part of its report.

I think it also addresses the other issues referenced above - please could this be confimed?

Note that it does not address the particular Kafka issue when compiling ZkUtils.scala, this file still needs to be excluded.

@sksamuel
Copy link
Member

sksamuel commented Feb 8, 2015

What's the kafka issue?

On 8 February 2015 at 22:16, maiflai [email protected] wrote:

I've published 1.0.8, which now produces the scoverage xml file as part of
its report.

I think it also addresses the other issues referenced above - please could
this be confimed?

Note that it does not address the particular Kafka issue when compiling
ZkUtils.scala, this file still needs to be excluded.


Reply to this email directly or view it on GitHub
#29 (comment)
.

@maiflai
Copy link
Contributor

maiflai commented Feb 8, 2015

scoverage/scalac-scoverage-plugin#93 - NullPointerException during icode phase.

@sksamuel
Copy link
Member

sksamuel commented Feb 8, 2015

Ah that one. ok

On 8 February 2015 at 22:31, maiflai [email protected] wrote:

scoverage/scalac-scoverage-plugin#93
scoverage/scalac-scoverage-plugin#93 -
NullPointerException during icode phase.


Reply to this email directly or view it on GitHub
#29 (comment)
.

@maiflai
Copy link
Contributor

maiflai commented Feb 8, 2015

Cheers - just wanted to avoid any confusion over what was included in the release

@avdv
Copy link
Author

avdv commented Feb 11, 2015

I think it also addresses the other issues referenced above - please could this be confimed?

Confirmed, works for me. Thanks! 👍

The only thing I noticed is that even when you remove the build/scoverage directory, the testScoverage task is regarded as up-to-date. So when running reportScoverage it generates a report with 0% coverage. I'm going to close this issue anyway, since that's a different problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants