Uploaded image for project: 'Nuxeo Java Client'
  1. Nuxeo Java Client
  2. JAVACLIENT-158

Fix coverage on nuxeo-java-client

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.2.0
    • Component/s: QA

      Description

      Sonar support was added with this commit on nuxeo-java-client repository.

      Reports are correctly sent to sonar.io but coverage is 0.0%.

      There're 8 unit tests detected, corresponding to unit tests in nuxeo-java-client module. Note that integration tests (presents in nuxeo-java-client-test) are not detected.

      Aim would be to have coverage for UT but also IT (even if it's in a different maven module).

      Configuration was made following the nuxeo main repository one.

      About CI, nuxeo-java-client has 4 multibranch pipeline jobs (one per nuxeo maintenance version and one for master):

      Only the master one do the analysis, as per:

      // do analysis only on VS Nuxeo master job
      if (env.STATUS_CONTEXT_NAME == 'nuxeo/master') {
          stage('analysis') {
              withEnv(['MAVEN_OPTS=-Xmx1g -server']) {
                  withCredentials([usernamePassword(credentialsId: 'c4ced779-af65-4bce-9551-4e6c0e0dcfe5', passwordVariable: 'SONARCLOUD_PWD', usernameVariable: '')]) {
                      if (env.BRANCH_NAME != 'master') {
                          TARGET_OPTION = "-Dsonar.branch.target=master"
                      } else {
                          TARGET_OPTION = ""
                      }
                      sh """#!/bin/bash -ex
                              mvn clean verify sonar:sonar -Dsonar.login=$SONARCLOUD_PWD \
                                -Dsonar.branch.name=${env.BRANCH_NAME} $TARGET_OPTION \
                                -P ${env.TARGET_PLATFORM},qa,sonar \
                                -Dit.jacoco.destFile=$WORKSPACE/target/jacoco-it.exec
                         """
                  }
              }
          }
      }
      

      You can find this extracted code in Jenkinsfile

      Note that analysis will be done for each branches.
      A future improvement could be to put analysis report into PR status.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: