From 75196ec77dfc17420ce6f24bd60d1f2d9e9b98a4 Mon Sep 17 00:00:00 2001 From: Vasileios Karakasis Date: Tue, 25 Jun 2024 00:37:53 +0200 Subject: [PATCH 1/6] Add separate codecov GH action --- .github/workflows/codecov.yaml | 21 +++++++++++++++++++++ requirements.txt | 1 + 2 files changed, 22 insertions(+) create mode 100644 .github/workflows/codecov.yaml diff --git a/.github/workflows/codecov.yaml b/.github/workflows/codecov.yaml new file mode 100644 index 0000000000..2d3d7d5b82 --- /dev/null +++ b/.github/workflows/codecov.yaml @@ -0,0 +1,21 @@ +name: Code coverage + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + name: Test python API + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v2 + with: + python-version: '3.12' + - name: Bootstrap reframe + run: ./bootstrap.sh + - name: Run tests and collect coverage + run: ./test_reframe.py --cov=reframe --cov-report=xml + - name: Upload coverage reports + uses: codecov/codecov-action@v4.2.0 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/requirements.txt b/requirements.txt index c045651cfe..d97571b2b9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,6 +6,7 @@ jsonschema==3.2.0 lxml==5.2.0 pytest==7.0.1; python_version < '3.8' pytest==8.1.1; python_version >= '3.8' +pytest-cov==5.0.0 pytest-forked==1.4.0; python_version == '3.6' pytest-forked==1.6.0; python_version >= '3.7' pytest-parallel==0.1.1 From 566c57cac5b168be3fb2aadb7cd9cfa0822dbbae Mon Sep 17 00:00:00 2001 From: Vasileios Karakasis Date: Thu, 27 Jun 2024 23:25:13 +0200 Subject: [PATCH 2/6] Fix flake8 issues --- reframe/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reframe/__init__.py b/reframe/__init__.py index c330b5a876..da85b977cf 100644 --- a/reframe/__init__.py +++ b/reframe/__init__.py @@ -22,5 +22,5 @@ # Import important names for user tests -from reframe.core.pipeline import * # noqa: F401, F403 -from reframe.core.decorators import * # noqa: F401, F403 +from reframe.core.pipeline import * # noqa: F401, F403, E402 +from reframe.core.decorators import * # noqa: F401, F403, E402 From fffbe426e85532f62286ac4786003c6528ed1dad Mon Sep 17 00:00:00 2001 From: Vasileios Karakasis Date: Thu, 27 Jun 2024 23:29:30 +0200 Subject: [PATCH 3/6] Install `pytest-cov` only in GH action --- .github/workflows/codecov.yaml | 4 +++- requirements.txt | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codecov.yaml b/.github/workflows/codecov.yaml index 2d3d7d5b82..77789c8c2e 100644 --- a/.github/workflows/codecov.yaml +++ b/.github/workflows/codecov.yaml @@ -14,7 +14,9 @@ jobs: - name: Bootstrap reframe run: ./bootstrap.sh - name: Run tests and collect coverage - run: ./test_reframe.py --cov=reframe --cov-report=xml + run: | + pip install pytest-cov + ./test_reframe.py --cov=reframe --cov-report=xml - name: Upload coverage reports uses: codecov/codecov-action@v4.2.0 env: diff --git a/requirements.txt b/requirements.txt index d97571b2b9..c045651cfe 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,7 +6,6 @@ jsonschema==3.2.0 lxml==5.2.0 pytest==7.0.1; python_version < '3.8' pytest==8.1.1; python_version >= '3.8' -pytest-cov==5.0.0 pytest-forked==1.4.0; python_version == '3.6' pytest-forked==1.6.0; python_version >= '3.7' pytest-parallel==0.1.1 From b798f4a5daf746c437c98010304355f5b27cac0d Mon Sep 17 00:00:00 2001 From: Vasileios Karakasis Date: Thu, 27 Jun 2024 23:51:22 +0200 Subject: [PATCH 4/6] Update codecov GH action --- .github/workflows/codecov.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codecov.yaml b/.github/workflows/codecov.yaml index 77789c8c2e..ed437adcdd 100644 --- a/.github/workflows/codecov.yaml +++ b/.github/workflows/codecov.yaml @@ -1,11 +1,11 @@ -name: Code coverage +name: ReFrame CI on: [push, pull_request] jobs: build: runs-on: ubuntu-latest - name: Test python API + name: Code coverage steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v2 From 294aadd68601023fd8335a923c19a5cc4a064c7f Mon Sep 17 00:00:00 2001 From: Vasileios Karakasis Date: Fri, 28 Jun 2024 00:28:24 +0200 Subject: [PATCH 5/6] Remove old coverage run --- .github/workflows/main.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 966f2b2768..3219688590 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,15 +18,8 @@ jobs: run: | ./bootstrap.sh - name: Generic Unittests - if: matrix.python-version != '3.8' run: | ./test_reframe.py - - name: Generic Unittests and Coverage Report - if: matrix.python-version == '3.8' - run: | - python -m pip install coverage - coverage run --source=reframe ./test_reframe.py - coverage report -m unittest-py36: runs-on: ubuntu-20.04 From 9416eafb107336e4181d919639d8701800eb49ca Mon Sep 17 00:00:00 2001 From: Vasileios Karakasis Date: Fri, 28 Jun 2024 00:35:48 +0200 Subject: [PATCH 6/6] Do not use the token --- .github/workflows/codecov.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codecov.yaml b/.github/workflows/codecov.yaml index ed437adcdd..f8c415e025 100644 --- a/.github/workflows/codecov.yaml +++ b/.github/workflows/codecov.yaml @@ -19,5 +19,5 @@ jobs: ./test_reframe.py --cov=reframe --cov-report=xml - name: Upload coverage reports uses: codecov/codecov-action@v4.2.0 - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + # env: + # CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}