Skip to content
Snippets Groups Projects
Unverified Commit e268ec24 authored by Casey's avatar Casey :recycle:
Browse files

pytest: generate coverage and junit reports (MR 2478)

parent 87515529
No related branches found
No related tags found
1 merge request!2478CI: generate coverage and test reports
......@@ -23,15 +23,17 @@ fi
# Use pytest-cov if it is installed to display code coverage
cov_arg=""
if python -c "import pytest_cov" >/dev/null 2>&1; then
cov_arg="--cov=pmb"
cov_arg="--cov=pmb --cov-report term --cov-report xml:coverage.xml"
fi
echo "Running pytest..."
echo "NOTE: use 'pmbootstrap log' to see the detailed log if running locally."
# shellcheck disable=SC2086
python -m pytest \
--color=yes \
-vv \
-x \
--junitxml=junit.xml \
$cov_arg \
-m "not skip_ci" \
"$@"
......@@ -43,10 +43,15 @@ pytest:
- "cp /home/build/.local/var/pmbootstrap/log_testsuite.txt ."
- "cp /home/build/.local/var/pmbootstrap/log.txt ."
artifacts:
when: on_failure
when: always
paths:
- "log_testsuite.txt"
- "log.txt"
reports:
coverage_report:
coverage_format: cobertura
path: coverage.xml
junit: junit.xml
# Ensure that tests pass on Python 3.10
pytest-python3.10:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment