- Generate Test reports and open coverage report
./gradlew test jacocoTestReport- Check coverage minimum of 70%
./gradlew clean test jacocoTestCoverageVerification- Run pmd checks in src folder
./gradlew pmdMain- Run pmd for test
./gradlew pmdTestCheck the current code quality and coverage using SonarQube.
- 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 sonarqubeStart the "SonarQube" instance
docker run -d --name sonarqube -e SONAR_ES_BOOTSTRAP_CHECKS_DISABLE=true -p 9000:9000 sonarqube:latest- Access SonarQube dashboard - http://localhost:9000
(default credentials ) login: admin password: admin
Ref: https://docs.sonarsource.com/sonarqube/latest/try-out-sonarqube/
- Step 1
- Select create a local project
- "Project display name" = wcc-backend
- "Project key" = wcc-backend
- "Main branch name" = *
- Step 2
- Choose the baseline for new code for this project
select "Use the global setting" - Click "Create Project" at the bottom
- Step 3
Generate token to replace in the project.
- Click "Locally" on the main dashboard
- Generate a token on the next screen ( choose Expires in - No expiration) [ Click Generate]
- Copy the token = "sqp_XXXXXXX" and replace in the file build.gradle.kts
property("sonar.token", "PLACE_YOUR_TOKEN_HERE")
./gradlew sonarQubeAnalysis -PlocalProfile