Skip to content

Latest commit

 

History

History
107 lines (72 loc) · 2.55 KB

File metadata and controls

107 lines (72 loc) · 2.55 KB

Quality Checks SETUP

Jacoco

./gradlew test jacocoTestReport
  • Check coverage minimum of 70%
./gradlew clean test jacocoTestCoverageVerification

PMD

  • Run pmd checks in src folder
./gradlew pmdMain
  • Run pmd for test
./gradlew pmdTest

SonarQube

Check the current code quality and coverage using SonarQube.

  • Run SonarQube analysis is available in the Pull request checks. image

SONAR (Optional)

Install sonarqube docker image locally

  • Make sure you have docker installed on your machine - Download the installer using the url https://docs.docker.com/get-docker/. (Prefer Docker Desktop Application)
  • Start the docker application. Double-click Docker.app to start Docker.

Get the “SonarQube” image using the command

docker pull sonarqube

Start the "SonarQube" instance

docker run -d --name sonarqube -e SONAR_ES_BOOTSTRAP_CHECKS_DISABLE=true -p 9000:9000 sonarqube:latest

Ref: https://docs.sonarsource.com/sonarqube/latest/try-out-sonarqube/

Set-up wcc-backend project on local sonarQube instance

  • Step 1
  1. Select create a local project
  2. "Project display name" = wcc-backend
  3. "Project key" = wcc-backend
  4. "Main branch name" = *
  • Step 2
  1. Choose the baseline for new code for this project
    select "Use the global setting"
  2. Click "Create Project" at the bottom
  • Step 3

Generate token to replace in the project.

  1. Click "Locally" on the main dashboard
  2. Generate a token on the next screen ( choose Expires in - No expiration) [ Click Generate]
  3. Copy the token = "sqp_XXXXXXX" and replace in the file build.gradle.kts
    property("sonar.token", "PLACE_YOUR_TOKEN_HERE")

Perform SONAR ANALYSIS

./gradlew sonarQubeAnalysis -PlocalProfile