From cbe1e303a28c3fa28a3a3127a87ed67f44bb6114 Mon Sep 17 00:00:00 2001 From: Plamen Valentinov Kolev <41479552+pvk-developer@users.noreply.github.com> Date: Mon, 18 Nov 2024 15:39:16 +0100 Subject: [PATCH] Update codecov and add flag for integration tests (#912) --- .github/workflows/integration.yml | 8 ++++++++ .github/workflows/unit.yml | 11 ++++++++--- .gitignore | 1 + tasks.py | 4 ++-- 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 81afd6a82..09263bb94 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -29,3 +29,11 @@ jobs: python -m pip install invoke .[test] - name: Run integration tests run: invoke integration + + - if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.9 + name: Upload integration codecov report + uses: codecov/codecov-action@v4 + with: + flags: integration + file: './integration_cov.xml' + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/unit.yml b/.github/workflows/unit.yml index 1b9a911bc..db76e79d4 100644 --- a/.github/workflows/unit.yml +++ b/.github/workflows/unit.yml @@ -31,6 +31,11 @@ jobs: run: invoke check-dependencies - name: Run Unit tests run: invoke unit - - if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.8 - name: Upload codecov report - uses: codecov/codecov-action@v2 + + - if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.9 + name: Upload unit codecov report + uses: codecov/codecov-action@v4 + with: + flags: unit + file: './unit_cov.xml' + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.gitignore b/.gitignore index 17b6d82f8..9f49143cf 100644 --- a/.gitignore +++ b/.gitignore @@ -46,6 +46,7 @@ coverage.xml *.cover .hypothesis/ .pytest_cache/ +*_cov.xml # Translations *.mo diff --git a/tasks.py b/tasks.py index c7bb51b34..e0cfb2d6d 100644 --- a/tasks.py +++ b/tasks.py @@ -32,13 +32,13 @@ def check_dependencies(c): def unit(c): c.run( 'python -m pytest ./tests/unit ./tests/performance/tests ./tests/datasets/tests ' - '--cov=rdt --cov-report=xml --cov-fail-under=100' + '--cov=rdt --cov-fail-under=100 --cov-report=xml:./unit_cov.xml' ) @task def integration(c): - c.run('python -m pytest ./tests/integration') + c.run('python -m pytest ./tests/integration --cov=rdt --cov-report=xml:./integration_cov.xml') @task