From 89d32f7a959ef54210968d46975a9c0ba9ca9e34 Mon Sep 17 00:00:00 2001 From: Jack Plowman <62281988+JackPlowman@users.noreply.github.com> Date: Sun, 29 Sep 2024 19:42:05 +0100 Subject: [PATCH] Fix SonarCloud Coverage --- .github/workflows/code-test.yml | 6 ++++++ Justfile | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/code-test.yml b/.github/workflows/code-test.yml index a441033..a289f0d 100644 --- a/.github/workflows/code-test.yml +++ b/.github/workflows/code-test.yml @@ -37,6 +37,12 @@ jobs: - name: Run Unit Tests run: just unit-test + - name: test + run: cat coverage.xml + + - name: Override Coverage Source Path for Sonar + run: sed -i "s/\/home\/runner\/work\/github-stats-analyser\/github-stats-analyser/\/github\/workspace<\/source>/g" /home/runner/work/github-stats-analyser/github-stats-analyser/coverage.xml + - name: SonarCloud Scan uses: SonarSource/sonarcloud-github-action@v3.0.0 env: diff --git a/Justfile b/Justfile index a2bcf20..4622610 100644 --- a/Justfile +++ b/Justfile @@ -34,10 +34,10 @@ run-with-defaults: DEBUG=true REPOSITORY_OWNER=JackPlowman poetry run python -m analyser unit-test: - poetry run pytest analyser --cov=analyser --cov-report=xml + poetry run pytest analyser --cov=. --cov-report=xml unit-test-debug: - poetry run pytest analyser --cov=analyser --cov-report=xml -vvvv + poetry run pytest analyser --cov=. --cov-report=xml -vvvv validate-schema: poetry run check-jsonschema --schemafile test/schema_validation/repository_statistics_schema.json test/schema_validation/repository_statistics.json