Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Java

    For java there are different plugins/properties that must be included in the pom.xml to execute the tests and record the coverage

    Properties

    Code Block
    languagexml
    <properties>
    
    ...
                    <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
                    <sonar.surefire.reportsPath>${project.build.directory}/surefire-reports</sonar.surefire.reportsPath>
                    <sonar.jacoco.reportPath>${project.build.directory}/coverage-reports/jacoco.exec</sonar.jacoco.reportPath>
                    <sonar.jacoco.itReportPath>${project.build.directory}/coverage-reports/jacoco-it.exec</sonar.jacoco.itReportPath>
                    <sonar.jacoco.reportMissing.force.zero>true</sonar.jacoco.reportMissing.force.zero>
                    <sonar.projectVersion>${project.version}</sonar.projectVersion>
                    <!-- Enable language to disable other language analysis -->
                    <sonar.language>java</sonar.language>
                    <sonar.exclusions>src/main/resources/**</sonar.exclusions>
    ...
    </properties>

    Surefire (Unit tests)

    This one is used to execute the unit tests, various config are available depending of the project need (https://maven.apache.org/surefire/maven-surefire-plugin/index.html)

    Code Block
    languagexml
    <plugin>
    	<groupId>org.apache.maven.plugins</groupId>
    	<artifactId>maven-surefire-plugin</artifactId>
    	<version>X.XX.X</version>
    	<configuration>
    		<forkCount>1</forkCount>
    		<reuseForks>true</reuseForks>
    		<useSystemClassLoader>false</useSystemClassLoader>
    	</configuration>
    </plugin>


    Failsafe (Integration tests)

    This one is used to execute the integration tests, various config are available depending of the project need (https://maven.apache.org/surefire/maven-failsafe-plugin/index.html)

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <version>X.XX.X</version>
        <executions>
          <execution>
             <id>integration-tests</id>
             <goals>
               <goal>integration-test</goal>
               <goal>verify</goal>
             </goals>
             <configuration>
               <additionalClasspathElements>
                  <additionalClasspathElement>${project.build.directory}/classes</additionalClasspathElement>
               </additionalClasspathElements>
               <includes>
                 <include>**/*ItCase.java</include>
               </includes>
               <forkCount>1</forkCount>
               <reuseForks>false</reuseForks>
               <useSystemClassLoader>false</useSystemClassLoader>
             </configuration>
          </execution>
        </executions>
    </plugin>

    Maven properties

  • Javascript

  • Python

    Section TBD