Git Product home page Git Product logo

Comments (7)

babineaum avatar babineaum commented on August 19, 2024

@gslowikowski wondering if you might be able to help me out. i tried to follow what you were saying over in the closed ticket i reffed above but im still getting 2 runs of test if i turn of all scoverage i dont get a report... so im kinda confused as to why you said to disable all tasks for scoverage in the pom.xml

from scoverage-maven-samples.

gslowikowski avatar gslowikowski commented on August 19, 2024

Hi @babineaum

Sorry for not responding for some time.

IMPORTANT!
When I'm writing about (not) adding scoverage tasks to pom.xml file I'm thinking about build section, not reporting. In short, reporting is OK.

Generally, I never add scoverage tasks to my poms (build section).
If I want coverage check, I run something like this mvn clean package scoverage:check.
If I want coverage report - mvn scoverage:report
If report must be added to Maven site, it has to be added to reporting section, like in the line you cited above.
If you run e.g. mvn test scoverage:check or mvn test scoverage:report the tests will run twice, once on uninstrumented classes (in test task) and second time on instrumented classes (in test task executed in lifecycle forked by scoverage:report task)

The issue scoverage/scoverage-maven-plugin#39 was about forking scoverage lifecycle from already forked scoverage lifecycle. It is possible, but does not make sense.

from scoverage-maven-samples.

babineaum avatar babineaum commented on August 19, 2024

Hmmm ok well i seem to have the same problem as the other person "ghost".

I guess my question is, is there a way to run a 'mvn clean install' and have the build create an artifact that I can deploy and also run instrumented tests without running the non instrumented tests as well?

Edit: I'll note that I am getting two runs of the tests, one pre the scoverage fork during the test phase, by scalattest-maven-plugin and the other during the scoverage fork when scoverage calls scalatest-maven-plugin and runs tests after instrumentation.

from scoverage-maven-samples.

gslowikowski avatar gslowikowski commented on August 19, 2024

You need two Maven calls, for example:

  • mvn clean install -DskipTests
  • mvn scoverage:report

There is no way (IMO) to set and clear skipTests flag interpreted by Surefire plugin depending on the context (scoverage or not).

from scoverage-maven-samples.

tenstriker avatar tenstriker commented on August 19, 2024

For me single mvn clean process-classes scoverage:report command works. proccess-classes generates classed dir under target so I can run my application. I don't attach any scoverage goal to build lifecycle in pom configuration.

from scoverage-maven-samples.

ahmedriza avatar ahmedriza commented on August 19, 2024

@gslowikowski
mvn clean package scoverage:check
still runs the build and tests twice. Is there a way to run the build and tests just once (similar to what JaCoCo does for Java) ?

from scoverage-maven-samples.

gslowikowski avatar gslowikowski commented on August 19, 2024

There is a way to avoid running tests twice now. Check this issue scoverage/scoverage-maven-plugin#61 please.

from scoverage-maven-samples.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.