mirror of
https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git
synced 2025-07-12 19:09:56 +03:00
pytest: generate coverage and junit reports (MR 2478)
Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
This commit is contained in:
parent
87515529cf
commit
e268ec24d5
2 changed files with 9 additions and 2 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue