From 1988460ab706189eb1ef69e81504365bb8157645 Mon Sep 17 00:00:00 2001 From: Alexander Tomokhov Date: Sun, 14 Apr 2024 14:12:21 +0400 Subject: [PATCH] WIP: test 3 --- .drone.yml | 2 +- flake.nix | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index 55595e9..bf2a81e 100644 --- a/.drone.yml +++ b/.drone.yml @@ -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 diff --git a/flake.nix b/flake.nix index ae4e173..d72b10b 100644 --- a/flake.nix +++ b/flake.nix @@ -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|${pkgs.lib.strings.escapeRegex self.outPath}|.|g' /tmp/coverage.xml") + machine.succeed("head /tmp/coverage.xml >&2") + machine.succeed("sed -i -E 's|${pkgs.lib.strings.escapeRegex self.outPath}|.|g' /tmp/coverage.xml") machine.copy_from_vm("/tmp/coverage.xml", ".") machine.succeed("coverage report --rcfile=.coveragerc --data-file=/tmp/.coverage >&2") '';