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

Plugin is not generating report #28

Closed
tenstriker opened this issue Jan 30, 2016 · 15 comments
Closed

Plugin is not generating report #28

tenstriker opened this issue Jan 30, 2016 · 15 comments

Comments

@tenstriker
Copy link

[INFO]
[INFO] <<< scoverage-maven-plugin:1.1.0:integration-report (default-cli) < [scoverage]verify @ myapp-rest <<<
[INFO]
[INFO] --- scoverage-maven-plugin:1.1.0:integration-report (default-cli) @ myapp ---
[INFO] Skipping SCoverage report generation
[INFO]
[INFO] --- scoverage-maven-plugin:1.1.0:report-only (default-cli) @ myapp ---
[INFO] Skipping SCoverage report generation

It keeps on skipping report generation. I tried version 1.1.1 and 1.1.0. Both exhibit same behavior.

maven command line:
clean -X scoverage:integration-report scoverage:report-only

It does instrument classes. I see following directories under target dir:
scoverage-classes
scoverage-classes.timestamp
scoverage-myapp.jar
scoverage-myapp.jar.original

but no reports directory

@gslowikowski
Copy link
Member

scoverage:report-only is redundant here.

Can you attach mvn clean scoverage:integration-report -X execution log (or send it directly to me, if you cannot publish it)?

@tenstriker
Copy link
Author

Not sure if I can share full detailed log. I have to check on that with my manager. but I can send specific part from logs if you direct me there. If you know possible cases I can check all of those. In my opinion mojo should tell reason for skipping reports though.

here's pom config for reference.

<plugin> <groupId>org.scoverage</groupId> <artifactId>scoverage-maven-plugin</artifactId> <version>1.1.1</version> <configuration> <scalaVersion>2.10.5</scalaVersion> <highlighting>true</highlighting> <minimumCoverage>80</minimumCoverage> <failOnMinimumCoverage>false</failOnMinimumCoverage> <excludes> <exclude>**/com/mycom/myproj/*.java</exclude> </excludes> <includes> <include>**/com/mycom/myproj/*.scala</include> </includes> </configuration> <executions> <execution> <goals> <goal>integration-check</goal> <!-- or integration-check --> </goals> <phase>test</phase> <!-- or any other phase --> </execution> </executions> </plugin>

Thanks

@gslowikowski
Copy link
Member

Try to remove executions from pom.xml and check if it helps.

@gslowikowski
Copy link
Member

What's your scala-maven-plugin, maven-surefire-plugin and maven-failsafe-plugin configuration?

@tenstriker
Copy link
Author

I presume your asking for their versions:
<artifactId>maven-scala-plugin</artifactId> <version>2.15.2</version>

<artifactId>maven-surefire-plugin</artifactId> <version>2.12</version>

I don't have maven-failsafe-plugin in pom

By the way, it's a mix scala/java project. We are running clover coverage report successfully on this project but for scala coverage I have created new jenkins setup since there's no single coverage for both scala and java

@gslowikowski
Copy link
Member

I mean configurations.
If you don't have maven-failsafe-plugin, how are integration tests executed?

@tenstriker
Copy link
Author

Using spring @IntegrationTest @WebIntegrationTest @TestExecutionListener and extending AbstractTestNGSpringContextTests it runs testsng suite as a part of unit test I think

@tenstriker
Copy link
Author

I removed execution tag from scoverage plugin. I added failsafe plugin. Looks like its running tests twice so I think I need to avoid running integration test as it's doing same thing. I also noticed following:

[INFO]
[INFO] <<< scoverage-maven-plugin:1.1.1:integration-check (default) < [scoverage]verify @ myapp <<<
[INFO]
[INFO] --- scoverage-maven-plugin:1.1.1:integration-check (default) @ myapp ---
[INFO] Cannot perform check, instrumentation not performed - skipping

@gslowikowski
Copy link
Member

I mean, how you configured integration tests execution in Maven.

Anyway, I think the reason of your problems is too old maven-scala-plugin. Read https://github.com/scoverage/scoverage-maven-plugin/#prerequisities--limitations.

@tenstriker
Copy link
Author

I tried using 3.2.1 maven-scala-plugin. I can build it on my local system and can see following dir being generated.
target/scoverage-data/scoverage.coverage.xml
Is that the one for coverage report?

@gslowikowski
Copy link
Member

target/scoverage-data/scoverage.coverage.xml contains information about instrumented code. Its existence means sources were instrumented. Instrumented sources are in target/scoverage-classes directory.

If there are no target/scoverage-data/scoverage-measurements.nnn files, either tests were not executed on instrumented code or tests were executed, but didn't call instrumented code at all.

When reports will be generated you will see them in:

  • target/cobertura.xml and target/scoverage.xml files - xml reports,
  • target/site/scoverage directory - html reports.

@gslowikowski
Copy link
Member

@tenstriker , did you make any progress?

@tenstriker
Copy link
Author

Oh yes, I was able to publish reports on jenkins as well. so mainly it was problem with older version of scala maven plugin as you mentioned. thank you.

@nitin2032dhir
Copy link

Hi,

i want to configure scoverage plugin with sonar using Jenkins.
How we can generate HTML reports using scoverage?
Do we need to add any entry in sonar-project.properties.
Currently, my build is generating only scoverage.xml file but to display coverage on Sonar i need Html reports. so that i can configure my Jenkins instance.

@gslowikowski
Copy link
Member

Plugin generates html reports in target/site/scoverage directory. Open new issue for your problem, please.

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

3 participants