Skip to content
Snippets Groups Projects
Unverified Commit a8681006 authored by Casey's avatar Casey :recycle: Committed by Oliver Smith
Browse files

CI: allow lint failures and fix pytest (MR 2252)


Adjust the pytest CI to work with the new tests.

It's useful to run pytest even when linters fail, so set allow_failure
for the lint jobs.

Signed-off-by: default avatarCaleb Connolly <caleb@postmarketos.org>
parent ca722b49
No related branches found
No related tags found
1 merge request!2252Type hinting and Chroot's (Caleb's amazing pmbootstrap v3 patch series!)
......@@ -26,47 +26,12 @@ if python -c "import pytest_cov" >/dev/null 2>&1; then
cov_arg="--cov=pmb"
fi
echo "Initializing pmbootstrap..."
if ! yes '' | ./pmbootstrap.py \
--details-to-stdout \
init \
>/tmp/pmb_init 2>&1; then
cat /tmp/pmb_init
exit 1
fi
# Make sure that the work folder format is up to date, and that there are no
# mounts from aborted test cases (#1595)
./pmbootstrap.py work_migrate
./pmbootstrap.py -q shutdown
# Make sure we have a valid device (#1128)
device="$(./pmbootstrap.py config device)"
pmaports="$(./pmbootstrap.py config aports)"
deviceinfo="$(ls -1 "$pmaports"/device/*/device-"$device"/deviceinfo)"
if ! [ -e "$deviceinfo" ]; then
echo "ERROR: Could not find deviceinfo file for selected device:" \
"$device"
echo "Expected path: $deviceinfo"
echo "Maybe you have switched to a branch where your device does not"
echo "exist? Use 'pmbootstrap config device qemu-amd64' to switch to"
echo "a valid device."
exit 1
fi
# Make sure pmaports is clean, some of the tests will fail otherwise
if [ -n "$(git -C "$pmaports" status --porcelain)" ]; then
echo "ERROR: pmaports dir is not clean"
exit 1
fi
echo "Running pytest..."
echo "NOTE: use 'pmbootstrap log' to see the detailed log if running locally."
pytest \
python -m pytest \
--color=yes \
-vv \
-x \
$cov_arg \
test \
-m "not skip_ci" \
"$@"
......@@ -44,6 +44,7 @@ pytest:
ruff:
stage: lint
allow_failure: true
script:
- ".ci/ruff.sh"
......@@ -54,6 +55,7 @@ shellcheck:
vermin:
stage: lint
allow_failure: true
script:
- ".ci/vermin.sh"
......@@ -70,6 +72,7 @@ mr-settings:
mypy:
stage: lint
allow_failure: true
script:
- ".ci/mypy.sh"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment