Fakultas Ilmu Komputer UI

Commit 5d56ed1d authored by Muhammad Ariq Basyar's avatar Muhammad Ariq Basyar
Browse files

Sonarqube, gitlab ci, and refactor tests

- modified sonarqube config file sonar-project.properties (config sonar tests and coverage)
- modified gitlab ci (add UnitTest dependencies to SonarScanner stage)
parents 05a0af47 086389b2
Pipeline #66484 passed with stages
in 5 minutes and 15 seconds
......@@ -34,16 +34,14 @@ Pylint:
informasi_fasilitas layanan_khusus new_rest_api oauth registrasi
SonarScanner:
dependencies:
- UnitTest
image:
name: sonarsource/sonar-scanner-cli:latest
entrypoint: [""]
stage: sonarqube
script:
- sonar-scanner
-Dsonar.host.url=https://pmpl.cs.ui.ac.id/sonarqube-advprog
-Dsonar.login=$SONARQUBE_TOKEN
-Dsonar.branch.name=$CI_COMMIT_REF_NAME
-Dsonar.projectKey=$SONARQUBE_PROJECT_KEY
- sonar-scanner -Dsonar.sources=.
Deployment:
image: ruby:2.4
......
# SonarScanner properties file
## Server
sonar.host.url=https://pmpl.cs.ui.ac.id/sonarqube
sonar.login=$SONARQUBE_TOKEN
sonar.host.url=https://pmpl.cs.ui.ac.id/sonarqube-advprog
sonar.login=${env.SONARQUBE_PROJECT_TOKEN}
## Project configuration
sonar.projectKey=$SONARQUBE_PROJECT_KEY
sonar.projectKey=${env.SONARQUBE_PROJECT_KEY}
## Path to sources
sonar.sources=.
sonar.exclusions=**/migrations/**, **/__init__.py, pplbackend/**, **/test.py, manage.py
#sonar.inclusions=
sonar.exclusions=**/migrations/**, **/__init__.py, pplbackend/**, manage.py, coverage.xml
## Path to tests
sonar.tests=.
#sonar.test.exclusions=
sonar.test.inclusions=**/test.py
sonar.test.inclusions=**/test*.py
## Source encoding
sonar.sourceEncoding=UTF-8
## Branch analysis
sonar.branch.name=$CI_COMMIT_REF_NAME
sonar.branch.name=${env.CI_COMMIT_REF_NAME}
## Coverage Report
sonar.coverage.exclusions=**/apps.py
sonar.python.coverage.reportPaths=coverage.xml
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment