When using "Build: Maven" task version 1.*,
and selecting a "Code Coverage Tool": JaCoCo for example,
the build run the tests twice.
In the log screen, I can see the following commands:
[command]C:\Windows\system32cmd.exe /D /S /C ""C:\Program Filesapache-maven-3.5.2\bin\mvn.cmd" -version"
[command]C:\Windows\system32cmd.exe /D /S /C ""C:\Program Filesapache-maven-3.5.2\bin\mvn.cmd" -f E:agent_work\34\s\pom.xml help:effective-pom"
[command]C:\Windows\system32cmd.exe /D /S /C ""C:\Program Filesapache-maven-3.5.2\bin\mvn.cmd" -f E:agent_work\34\s\pom.xml clean package "-Dsonar.host.url=http://mySonar:9000/" "-Dsonar.login=**" "-Dsonar.password=" "-Dsonar.projectName=myProject" "-Dsonar.projectKey=myProject" sonar:sonar checkstyle:checkstyle findbugs:findbugs pmd:pmd"
[command]C:\Windows\system32cmd.exe /D /S /C ""C:\Program Filesapache-maven-3.5.2\bin\mvn.cmd" -f E:agent_work\34\s\pom.xml verify"
As I have some tests that take long time to run, running the tests twice every build make the build time really worse.
There is no error logs
@igorpaladino The "verify" step is only run if JaCoCo is selected as the code coverage tool because it binds to the "verify" phase. However, I think the Maven task could be smarter by combining the "clean package" run with the "verify" run. We'll get this enhancement on our backlog.
Hi @leantk ,
is there any chance you may resolve this issue?
Thanks
Hi @afeblot, at the moment we don't have the bandwidth to pick-up this change unfortunately. I can circle back to it again after a couple sprints and try and get some resources on it. If you want/need it done sooner, we take contributions on the tasks since they are open source so we would gladly accept a PR. Just tag me on it and I'd review it for submission.
For anybody stumbling accross this issue here is a workaround. Not 100% sure it has no unintended side effects though.
Just add the maven option:
-DskipTests
It leads to the tests being skipped in your own maven task and only beeing executed in the newly added verify task.
Edit:
The unintened side effect is that the Azure DevOps Tests tab is missing as these informations are derived from th tests in your maven task.
is the issue resolved ??
Im facing it now while working on codeCoverage
Can someone please help me ?
any update on this issue ??
is this issue resolved ?
@subhaKiruba Could you please provide more technical details about this issue (environment description, part of pipelines file, logs in debug mode)
@subhaKiruba I'm closing due to lack of activity, please feel free to reopen if issue is still actual for you.
Closing for "lack of activity" whereas somebody pinged for an update 13 days ago?
@sdobrodeev, for sure, I'm still waiting/hoping for this to get fixed, please reopen it (I can't).
In our case, and probably as well for everyone else, the issue is exactly as described initially by @pjquirk : https://github.com/microsoft/azure-pipelines-tasks/issues/6458#issuecomment-367459714 :
The maven verify step automatically added by the task when jacoco is enabled executes the tests which were already executed as part of the main "clean install" goal the task was set with.
Hi @igorpaladino related changes has been rolled out - I'm closing it at the moment, please feel free to reopen it if issue appears again
Most helpful comment
@igorpaladino The "verify" step is only run if JaCoCo is selected as the code coverage tool because it binds to the "verify" phase. However, I think the Maven task could be smarter by combining the "clean package" run with the "verify" run. We'll get this enhancement on our backlog.