From a650d75dad9f2d843cd34019b90e43d036d79728 Mon Sep 17 00:00:00 2001 From: Uchechukwu Orji Date: Wed, 12 Jun 2024 10:00:37 +0100 Subject: [PATCH] update tasks file which generates xml cov report --- .github/workflows/backend-Tests.yaml | 5 ++--- backend/pyproject.toml | 1 - backend/tasks.py | 1 + worker/tasks.py | 1 + 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/backend-Tests.yaml b/.github/workflows/backend-Tests.yaml index 968138e..515048f 100644 --- a/.github/workflows/backend-Tests.yaml +++ b/.github/workflows/backend-Tests.yaml @@ -50,12 +50,11 @@ jobs: working-directory: backend env: POSTGRES_URI: postgresql+psycopg://postgres:postgres@localhost:5432/postgres - run: pytest --cov=./ --cov-report=xml + run: inv coverage --args "-vvv" - name: Upload coverage report to codecov uses: codecov/codecov-action@v3 with: - directory: backend - files: ./coverage.xml + working-directory: backend fail_ci_if_error: true token: ${{ secrets.CODECOV_TOKEN }} diff --git a/backend/pyproject.toml b/backend/pyproject.toml index 105ecf6..a2b7099 100644 --- a/backend/pyproject.toml +++ b/backend/pyproject.toml @@ -50,7 +50,6 @@ check = [ test = [ "pytest==8.0.0", "coverage==7.4.1", - "pytest-cov==5.0.0", ] dev = [ "pre-commit==3.6.0", diff --git a/backend/tasks.py b/backend/tasks.py index a95c71a..87cd552 100644 --- a/backend/tasks.py +++ b/backend/tasks.py @@ -24,6 +24,7 @@ def report_cov(ctx: Context, *, html: bool = False): """report coverage""" ctx.run("coverage combine", warn=True, pty=use_pty) ctx.run("coverage report --show-missing", pty=use_pty) + ctx.run("coverage xml", pty=use_pty) if html: ctx.run("coverage html", pty=use_pty) diff --git a/worker/tasks.py b/worker/tasks.py index a95c71a..87cd552 100644 --- a/worker/tasks.py +++ b/worker/tasks.py @@ -24,6 +24,7 @@ def report_cov(ctx: Context, *, html: bool = False): """report coverage""" ctx.run("coverage combine", warn=True, pty=use_pty) ctx.run("coverage report --show-missing", pty=use_pty) + ctx.run("coverage xml", pty=use_pty) if html: ctx.run("coverage html", pty=use_pty)