Skip to content

Commit 9d8b197

Browse files
authored
Merge pull request #3220 from vkarak/ci/re-enable-codecov
[ci] Re-enable codecov in the project
2 parents 41587cc + af35910 commit 9d8b197

File tree

10 files changed

+41
-22
lines changed

10 files changed

+41
-22
lines changed

.github/pseudo-cluster/reframe/docker-entrypoint.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ sudo service munge start
88
cp -r /usr/local/share/reframe .
99
cd reframe
1010
./bootstrap.sh
11+
pip install pytest-cov
1112

1213
echo "Running unittests with backend scheduler: ${BACKEND}"
1314

1415
tempdir=$(mktemp -d -p /scratch)
15-
TMPDIR=$tempdir ./test_reframe.py -v \
16+
TMPDIR=$tempdir ./test_reframe.py --cov=reframe --cov-report=xml \
1617
--rfm-user-config=ci-scripts/configs/ci-cluster.py \
1718
--rfm-user-system=pseudo-cluster:compute-${BACKEND:-squeue}

.github/workflows/main.yml

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,11 @@ jobs:
1818
run: |
1919
./bootstrap.sh
2020
- name: Generic Unittests
21-
if: matrix.python-version != '3.8'
2221
run: |
23-
./test_reframe.py
24-
- name: Generic Unittests and Coverage Report
25-
if: matrix.python-version == '3.8'
26-
run: |
27-
python -m pip install coverage
28-
coverage run --source=reframe ./test_reframe.py
29-
coverage report -m
22+
pip install pytest-cov
23+
./test_reframe.py --cov=reframe --cov-report=xml
24+
- name: Upload coverage reports
25+
uses: codecov/codecov-action@v4.2.0
3026

3127
unittest-py-eol:
3228
runs-on: ubuntu-latest
@@ -40,7 +36,10 @@ jobs:
4036
docker build --build-arg PYTHON_VERSION=${{ matrix.python-version }} -f ci-scripts/dockerfiles/reframe-python.dockerfile -t reframe-python${{ matrix.python-version }}:latest .
4137
- name: Run Unittests
4238
run: |
43-
docker run reframe-python${{ matrix.python-version }}:latest
39+
docker run --name reframe-python${{ matrix.python-version }} reframe-python${{ matrix.python-version }}:latest
40+
docker cp reframe-python${{ matrix.python-version }}:/home/rfmuser/reframe/coverage.xml .
41+
- name: Upload coverage reports
42+
uses: codecov/codecov-action@v4.2.0
4443

4544
unittest-macos:
4645
runs-on: macos-latest
@@ -58,7 +57,10 @@ jobs:
5857
./bootstrap.sh
5958
- name: Generic Unittests
6059
run: |
61-
./test_reframe.py
60+
pip install pytest-cov
61+
./test_reframe.py --cov=reframe --cov-report=xml
62+
- name: Upload coverage reports
63+
uses: codecov/codecov-action@v4.2.0
6264

6365
modulestest:
6466
runs-on: ubuntu-latest
@@ -78,7 +80,10 @@ jobs:
7880
docker build -f ci-scripts/dockerfiles/reframe-${{ matrix.modules-version }}.dockerfile -t reframe-${{ matrix.modules-version }}:latest .
7981
- name: Run Unittests
8082
run: |
81-
docker run reframe-${{ matrix.modules-version }}:latest
83+
docker run --name=reframe-${{ matrix.modules-version }} reframe-${{ matrix.modules-version }}:latest
84+
docker cp reframe-${{ matrix.modules-version }}:/home/rfmuser/reframe/coverage.xml .
85+
- name: Upload coverage reports
86+
uses: codecov/codecov-action@v4.2.0
8287

8388
eb-spack-howto:
8489
runs-on: ubuntu-latest

.github/workflows/test-flux.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ jobs:
3030
run: |
3131
apt-get update && apt-get install -y python3-pip
3232
./bootstrap.sh
33+
pip install pytest-cov
3334
export PATH=$PWD/bin:$PATH
3435
which reframe
3536
@@ -40,4 +41,6 @@ jobs:
4041
which reframe
4142
flux start reframe -c examples/howto/flux -C examples/howto/flux/settings.py -l
4243
flux start reframe -c examples/howto/flux -C examples/howto/flux/settings.py -r
43-
flux start python3 ./test_reframe.py --rfm-user-config=examples/howto/flux/settings.py -vvvv
44+
flux start python3 ./test_reframe.py --cov=reframe --cov-report=xml --rfm-user-config=examples/howto/flux/settings.py
45+
- name: Upload coverage reports
46+
uses: codecov/codecov-action@v4.2.0

.github/workflows/test-schedulers.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ jobs:
1919
- name: Build Images
2020
run: |
2121
docker compose -f .github/pseudo-cluster/docker-compose.yml build
22-
- name: Run Unittests with ${{ matrix.scheduler }} scheduler
22+
- name: Run unit tests with ${{ matrix.scheduler }} scheduler
2323
run: |
2424
BACKEND=${{ matrix.scheduler }} docker compose -f .github/pseudo-cluster/docker-compose.yml up --abort-on-container-exit --exit-code-from unittest-sched
25+
_exitcode=$?
26+
docker cp unittest-sched:/home/admin/reframe/coverage.xml .
27+
exit $_exitcode
28+
- name: Upload coverage reports
29+
uses: codecov/codecov-action@v4.2.0

ci-scripts/dockerfiles/reframe-lmod.dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,6 @@ COPY --chown=rfmuser . /home/rfmuser/reframe/
2020
WORKDIR /home/rfmuser/reframe
2121

2222
RUN ./bootstrap.sh
23+
RUN pip install pytest-cov
2324

24-
CMD ["/bin/bash", "-c", "./test_reframe.py --rfm-user-config=ci-scripts/configs/lmod.py -v"]
25+
CMD ["/bin/bash", "-c", "./test_reframe.py --cov=reframe --cov-report=xml --rfm-user-config=ci-scripts/configs/lmod.py"]

ci-scripts/dockerfiles/reframe-lmod77.dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,6 @@ COPY --chown=rfmuser . /home/rfmuser/reframe/
2020
WORKDIR /home/rfmuser/reframe
2121

2222
RUN ./bootstrap.sh
23+
RUN pip install pytest-cov
2324

24-
CMD ["/bin/bash", "-c", "./test_reframe.py --rfm-user-config=ci-scripts/configs/lmod.py -v"]
25+
CMD ["/bin/bash", "-c", "./test_reframe.py --cov=reframe --cov-report=xml --rfm-user-config=ci-scripts/configs/lmod.py"]

ci-scripts/dockerfiles/reframe-python.dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@ COPY --chown=rfmuser . /home/rfmuser/reframe/
1818
WORKDIR /home/rfmuser/reframe
1919

2020
RUN ./bootstrap.sh +docs
21+
RUN pip install pytest-cov
2122

22-
CMD ["/bin/bash", "-c", "./test_reframe.py -v"]
23+
CMD ["/bin/bash", "-c", "./test_reframe.py --cov=reframe --cov-report=xml"]

ci-scripts/dockerfiles/reframe-tmod32.dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
FROM ghcr.io/reframe-hpc/tmod:3.2.10
66

77
# ReFrame requirements
8-
RUN yum -y install gcc make git python3
8+
RUN yum -y install gcc make git python3 python3-pip
99

1010
# ReFrame user
1111
RUN useradd -ms /bin/bash rfmuser
12+
RUN pip3 install pytest-cov
1213

1314
USER rfmuser
1415

@@ -19,4 +20,4 @@ WORKDIR /home/rfmuser/reframe
1920

2021
RUN ./bootstrap.sh
2122

22-
CMD ["/bin/bash", "-c", "./test_reframe.py --rfm-user-config=ci-scripts/configs/tmod32.py -v"]
23+
CMD ["/bin/bash", "-c", "./test_reframe.py --cov=reframe --cov-report=xml --rfm-user-config=ci-scripts/configs/tmod32.py"]

ci-scripts/dockerfiles/reframe-tmod4.dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,6 @@ COPY --chown=rfmuser . /home/rfmuser/reframe/
2121
WORKDIR /home/rfmuser/reframe
2222

2323
RUN ./bootstrap.sh
24+
RUN pip install pytest-cov
2425

25-
CMD ["/bin/bash", "-c", "./test_reframe.py --rfm-user-config=ci-scripts/configs/tmod4.py -v"]
26+
CMD ["/bin/bash", "-c", "./test_reframe.py --cov=reframe --cov-report=xml --rfm-user-config=ci-scripts/configs/tmod4.py"]

reframe/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@
2222

2323

2424
# Import important names for user tests
25-
from reframe.core.pipeline import * # noqa: F401, F403
26-
from reframe.core.decorators import * # noqa: F401, F403
25+
from reframe.core.pipeline import * # noqa: F401, F403, E402
26+
from reframe.core.decorators import * # noqa: F401, F403, E402

0 commit comments

Comments
 (0)