Skip to content

scoverage + specs2? #13

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

Closed
StarWindMoonCloud opened this issue Dec 18, 2014 · 6 comments
Closed

scoverage + specs2? #13

StarWindMoonCloud opened this issue Dec 18, 2014 · 6 comments
Milestone

Comments

@StarWindMoonCloud
Copy link

My project is current using specs2 for unit test and functional test.
I was looking for a tool to report coverage and found Scoverage.

After some initial try, now I'm wondering if scoverage would work upon specs2.
Thus I created a test project as below:
https://github.com/StarWindMoonCloud/scoverage-specs2-test

It's saying "Cannot perform check, instrumentation not performed" when run "mvn scoverage:check", why's that, does it mean scoverage + specs2 won't work?
If that is the case, do you have other recommendation?

risestoke-lm:scoverage-specs2-test qili$ mvn scoverage:check
[INFO]
[INFO] --- maven-specs2-plugin:0.4.2:run-specs (test) @ scoverage-spec2-test ---
[INFO] com.qili.SampleTest:
test input
[INFO] Success: 1 Error: 0 Failure: 0 Skipped: 0
[INFO]
[INFO] <<< scoverage-maven-plugin:1.0.1:check (default-cli) < [scoverage]test @ scoverage-spec2-test <<<
[INFO]
[INFO] --- scoverage-maven-plugin:1.0.1:check (default-cli) @ scoverage-spec2-test ---
[INFO] Cannot perform check, instrumentation not performed - skipping
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS

mvn -v
Apache Maven 3.2.3 (33f8c3e1027c3ddde99d3cdebad2656a31e8fdf4; 2014-08-12T04:58:10+08:00)
Maven home: /usr/local/apache-maven
Java version: 1.8.0_25, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.9.5", arch: "x86_64", family: "mac"

@gslowikowski
Copy link
Member

You missed one requirement - https://github.com/scoverage/scoverage-maven-plugin#scala-version-configuration. I have to highlight it somehow.

There is a line about it In Maven execution log:

[INFO] Skipping SCoverage execution - Scala version not set

I will change log level from INFO to WARN in the future.

In your pom.xml file properties section should look like:

    <properties>
        <scoverage.plugin.version>1.0.1</scoverage.plugin.version>
        <scala.version>2.10.3</scala.version>
    </properties>

and (optionally) scala-library dependency version can be specified using this new property:

        <dependency>
            <groupId>org.scala-lang</groupId>
            <artifactId>scala-library</artifactId>
            <version>${scala.version}</version>
        </dependency>

@gslowikowski
Copy link
Member

One more problem, you use very old version of maven-scala-plugin (2.15.2). After changing to:

                <groupId>net.alchim31.maven</groupId>
                <artifactId>scala-maven-plugin</artifactId>
                <version>3.2.0</version>

SCoverage works (groupId and artifactId changed as well).

I will investigate what is the minimum required version of scala-maven-plugin plugin.

@StarWindMoonCloud
Copy link
Author

Thank you gslowikowski a lot for the valuable response.
Scoverage is working well now.

But I disagree w/ your first comment, scala version is actually set (https://github.com/StarWindMoonCloud/scoverage-specs2-test/blob/master/pom.xml#L19), looks to me scoverage is not reporting correctly here.

@gslowikowski
Copy link
Member

  1. I've checked, required scala-maven-plugin version is 3.0.0+
  2. plugin does not search for scala-lang:scala-library dependency to check it's version; maybe it could, but only when declared directly, for technical reasons transitive dependencies cannot be checked

Can we close this issue?

gslowikowski added a commit that referenced this issue Dec 22, 2014
…ies, check direct dependencies (transitive cannot be checked in "generate-resources" Maven lifecycle phase) looking for "org.scala-lang:scala-library" and use its version, if found.

This improvement was suggested in #13.
gslowikowski added a commit that referenced this issue Dec 22, 2014
…s was not clear, see #13), version upgraded from 1.0.1 to 1.0.2 in preparation for 1.0.2 release.
@gslowikowski
Copy link
Member

1.0.2 version released. You don't have to use property to define Scala version, plugin checks direct dependencies, if no version defined using a property or plugin configuration parameter.

@StarWindMoonCloud
Copy link
Author

Sounds cool, thank you for the quick fix

StarWindMoonCloud pushed a commit to StarWindMoonCloud/scoverage-specs2-test that referenced this issue Jan 8, 2015
@gslowikowski gslowikowski added this to the 1.0.2 milestone Jan 9, 2015
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

2 participants