*** Wartungsfenster jeden ersten Mittwoch vormittag im Monat ***

Skip to content
Snippets Groups Projects
Commit 376d3268 authored by Moser, Maximilian's avatar Moser, Maximilian
Browse files

Make SonarQube pick up the coverage report

* create coverage report with `coverage xml`
* add coverage.xml as artifact
* exclude tests and JS from coverage in SonarQube
parent 3e522625
No related branches found
No related tags found
1 merge request!157Clean up and modernize project structure
......@@ -13,12 +13,20 @@ run-tests:
- ./run-tests.sh
- deactivate
coverage: /TOTAL.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/
artifacts:
paths:
- coverage.xml
when: on_success
access: developer
expire_in: "10 mins"
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
- if: $CI_COMMIT_TAG =~ /^v\d+/
sonarqube-check:
stage: testing
needs:
- run-tests
variables:
SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache
GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task
......
......@@ -45,5 +45,6 @@ eval "$(docker-services-cli up --db "${DB:-postgresql}" --search "${SEARCH:-open
# Note: expansion of pytest_args looks like below to not cause an unbound
# variable error when 1) "nounset" and 2) the array is empty.
pytest ${pytest_args[@]+"${pytest_args[@]}"}
coverage xml
tests_exit_code=$?
exit "$tests_exit_code"
sonar.projectKey=fairdata_invenio-theme-tuw_AXp2xneNQz8akf6NDIUZ
sonar.qualitygate.wait=true
sonar.python.version=3
sonar.python.coverage.reportPaths=coverage.xml
sonar.coverage.exclusions=tests/*,**/*.js
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment