WIP: test 3

This commit is contained in:
Alexander Tomokhov 2024-04-14 14:12:21 +04:00
parent 943d3a4d7e
commit 1988460ab7
2 changed files with 3 additions and 2 deletions

View File

@ -6,7 +6,7 @@ steps:
- name: Run Tests and Generate Coverage Report
commands:
- 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
- sonar-scanner -Dsonar.projectKey=SelfPrivacy-REST-API -Dsonar.sources="$PWD" -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

View File

@ -152,7 +152,8 @@
start_all()
machine.succeed("cd ${vmtest-src-dir} && coverage run --data-file=/tmp/.coverage -m pytest -p no:cacheprovider -v >&2")
machine.succeed("cd ${vmtest-src-dir} && coverage xml --data-file=/tmp/.coverage -o /tmp/coverage.xml >&2")
machine.succeed("sed -E 's|<source>${pkgs.lib.strings.escapeRegex self.outPath}</source>|<source>.</source>|g' /tmp/coverage.xml")
machine.succeed("head /tmp/coverage.xml >&2")
machine.succeed("sed -i -E 's|<source>${pkgs.lib.strings.escapeRegex self.outPath}</source>|<source>.</source>|g' /tmp/coverage.xml")
machine.copy_from_vm("/tmp/coverage.xml", ".")
machine.succeed("coverage report --rcfile=.coveragerc --data-file=/tmp/.coverage >&2")
'';