mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-16 15:43:16 +00:00
fix ci: pass coverage.xml to sonar-scanner
This commit is contained in:
parent
962e8d5ca7
commit
34e1f55a7c
|
@ -5,8 +5,8 @@ name: default
|
|||
steps:
|
||||
- name: Run Tests and Generate Coverage Report
|
||||
commands:
|
||||
- nix flake check -L
|
||||
- sonar-scanner -Dsonar.projectKey=SelfPrivacy-REST-API -Dsonar.sources=. -Dsonar.host.url=http://analyzer.lan:9000 -Dsonar.login="$SONARQUBE_TOKEN"
|
||||
- VM_TEST_OUT_PATH="$(nix build .#checks.x86_64-linux.default --no-link --print-out-paths --print-build-logs)"
|
||||
- sonar-scanner -Dsonar.projectKey=SelfPrivacy-REST-API -Dsonar.sources=. -Dsonar.host.url=http://analyzer.lan:9000 -Dsonar.login="$SONARQUBE_TOKEN" -Dsonar.python.coverage.reportPaths="$VM_TEST_OUT_PATH/coverage.xml" -Dsonar.python.version=3.10
|
||||
environment:
|
||||
SONARQUBE_TOKEN:
|
||||
from_secret: SONARQUBE_TOKEN
|
||||
|
|
|
@ -150,9 +150,9 @@
|
|||
testScript = ''
|
||||
start_all()
|
||||
machine.succeed("cd ${vmtest-src-dir} && coverage run --data-file=/tmp/.coverage -m pytest -p no:cacheprovider -v >&2")
|
||||
machine.succeed("coverage xml --rcfile=${vmtest-src-dir}/.coveragerc --data-file=/tmp/.coverage >&2")
|
||||
machine.copy_from_vm("coverage.xml", ".")
|
||||
machine.succeed("coverage report >&2")
|
||||
machine.succeed("cd ${vmtest-src-dir} && coverage xml --data-file=/tmp/.coverage -o /tmp/coverage.xml >&2")
|
||||
machine.copy_from_vm("/tmp/coverage.xml", ".")
|
||||
machine.succeed("coverage report --rcfile=.coveragerc --data-file=/tmp/.coverage >&2")
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue