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: ...@@ -34,16 +34,14 @@ Pylint:
informasi_fasilitas layanan_khusus new_rest_api oauth registrasi informasi_fasilitas layanan_khusus new_rest_api oauth registrasi
SonarScanner: SonarScanner:
dependencies:
- UnitTest
image: image:
name: sonarsource/sonar-scanner-cli:latest name: sonarsource/sonar-scanner-cli:latest
entrypoint: [""] entrypoint: [""]
stage: sonarqube stage: sonarqube
script: script:
- sonar-scanner - sonar-scanner -Dsonar.sources=.
-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
Deployment: Deployment:
image: ruby:2.4 image: ruby:2.4
......
# SonarScanner properties file # SonarScanner properties file
## Server ## Server
sonar.host.url=https://pmpl.cs.ui.ac.id/sonarqube sonar.host.url=https://pmpl.cs.ui.ac.id/sonarqube-advprog
sonar.login=$SONARQUBE_TOKEN sonar.login=${env.SONARQUBE_PROJECT_TOKEN}
## Project configuration ## Project configuration
sonar.projectKey=$SONARQUBE_PROJECT_KEY sonar.projectKey=${env.SONARQUBE_PROJECT_KEY}
## Path to sources ## Path to sources
sonar.sources=. sonar.sources=.
sonar.exclusions=**/migrations/**, **/__init__.py, pplbackend/**, **/test.py, manage.py sonar.exclusions=**/migrations/**, **/__init__.py, pplbackend/**, manage.py, coverage.xml
#sonar.inclusions=
## Path to tests ## Path to tests
sonar.tests=. sonar.tests=.
#sonar.test.exclusions= sonar.test.inclusions=**/test*.py
sonar.test.inclusions=**/test.py
## Source encoding ## Source encoding
sonar.sourceEncoding=UTF-8 sonar.sourceEncoding=UTF-8
## Branch analysis ## Branch analysis
sonar.branch.name=$CI_COMMIT_REF_NAME sonar.branch.name=${env.CI_COMMIT_REF_NAME}
## Coverage Report ## Coverage Report
sonar.python.coverage.reportPaths=coverage.xml sonar.coverage.exclusions=**/apps.py
\ No newline at end of file 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