GithubHelp home page GithubHelp logo

Comments (6)

Godin avatar Godin commented on June 9, 2024 1

Tests are executed and the expected report is generated after the removal of junit-platform-launcher and junit-platform-runner from test dependencies - steinarb/osgi-service#2

from jacoco.

marchof avatar marchof commented on June 9, 2024

Hi @steinarb, please understand that we cannot provide support for other products like Sonar here.

Can you please create JaCoCo html reports and check the coverage in these reports? Thx

from jacoco.

Godin avatar Godin commented on June 9, 2024

This project lost code coverage when moving from jacoco 0.8.7 to 0.8..10 https://github.com/steinarb/osgi-service

This doesn't seem to be related to the update of JaCoCo version, because

after checkout of your project at commit bfc0f8944250ae3a61dd41a6f8c98e4c2abe108f
and the following change (i.e. downgrade of parent pom version and update of JaCoCo version to 0.8.10)

@@ -17,7 +17,7 @@
     <parent>
         <groupId>no.priv.bang.pom</groupId>
         <artifactId>bang-pom</artifactId>
-        <version>1.1.33</version>
+        <version>1.1.30</version>
     </parent>
     <groupId>no.priv.bang.osgiservice</groupId>
     <artifactId>osgiservice-parent</artifactId>
@@ -41,6 +41,15 @@
     </properties>

     <build>
+      <pluginManagement>
+        <plugins>
+            <plugin>
+                <groupId>org.jacoco</groupId>
+                <artifactId>jacoco-maven-plugin</artifactId>
+                <version>0.8.10</version>
+            </plugin>
+        </plugins>
+      </pluginManagement>
         <plugins>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>

execution of

mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent verify

produces the following JaCoCo HTML report

Screenshot 2023-07-17 at 10 58 50

Whereas the same command with the following modification (i.e. without downgrade of parent pom version and with JaCoCo version 0.8.7)

@@ -41,6 +41,15 @@
     </properties>

     <build>
+      <pluginManagement>
+        <plugins>
+            <plugin>
+                <groupId>org.jacoco</groupId>
+                <artifactId>jacoco-maven-plugin</artifactId>
+                <version>0.8.7</version>
+            </plugin>
+        </plugins>
+      </pluginManagement>
         <plugins>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>

produces the following report

Screenshot 2023-07-17 at 10 51 01

Therefore look at what else (besides JaCoCo version) changed in the parent pom.

from jacoco.

Godin avatar Godin commented on June 9, 2024

The culprit is the following change - steinarb/bang-bompom@b0bf04d
i.e. the same command after checkout of your project at commit bfc0f8944250ae3a61dd41a6f8c98e4c2abe108f
and the following change

@@ -41,6 +41,18 @@
     </properties>

     <build>
+      <pluginManagement>
+        <plugins>
+            <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-surefire-plugin</artifactId>
+                    <version>2.22.2</version>
+                </plugin>
+        </plugins>
+      </pluginManagement>
         <plugins>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>

produces expected report.

from jacoco.

Godin avatar Godin commented on June 9, 2024

maven-surefire-plugin version 3.0.0-M4 produces expected report, whereas 3.0.0-M5 does not

from jacoco.

Godin avatar Godin commented on June 9, 2024

Before steinarb/osgi-service@879553e
(i.e. before maven-surefire-plugin version update)

you had

[INFO] --- surefire:2.22.2:test (default-test) @ osgiservice.users ---
[INFO]
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running no.priv.bang.osgiservice.users.UserRolesTest
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.023 s - in no.priv.bang.osgiservice.users.UserRolesTest
[INFO] Running no.priv.bang.osgiservice.users.RoleTest
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 s - in no.priv.bang.osgiservice.users.RoleTest
[INFO] Running no.priv.bang.osgiservice.users.UserManagementServiceTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.716 s - in no.priv.bang.osgiservice.users.UserManagementServiceTest
[INFO] Running no.priv.bang.osgiservice.users.UsersExceptionTest
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 s - in no.priv.bang.osgiservice.users.UsersExceptionTest
[INFO] Running no.priv.bang.osgiservice.users.UserTest
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 s - in no.priv.bang.osgiservice.users.UserTest
[INFO] Running no.priv.bang.osgiservice.users.PermissionTest
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 s - in no.priv.bang.osgiservice.users.PermissionTest
[INFO] Running no.priv.bang.osgiservice.users.UsersPasswordsNotIdenticalExceptionTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 s - in no.priv.bang.osgiservice.users.UsersPasswordsNotIdenticalExceptionTest
[INFO] Running no.priv.bang.osgiservice.users.UserAndPasswordsTest
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 s - in no.priv.bang.osgiservice.users.UserAndPasswordsTest
[INFO] Running no.priv.bang.osgiservice.users.RolePermissionsTest
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 s - in no.priv.bang.osgiservice.users.RolePermissionsTest
[INFO] Running no.priv.bang.osgiservice.users.UsersPasswordEmptyExceptionTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 s - in no.priv.bang.osgiservice.users.UsersPasswordEmptyExceptionTest
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 20, Failures: 0, Errors: 0, Skipped: 0

whereas after

[INFO] --- surefire:3.1.2:test (default-test) @ osgiservice.users ---
[INFO] Using auto detected provider org.apache.maven.surefire.junit4.JUnit4Provider
[INFO]
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

no tests were executed, so no coverage as expected.
And why maven-surefire-plugin after upgrade does not execute your tests is clearly not a question to JaCoCo.

from jacoco.

Related Issues (20)

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.