ci/pytest: make sure tests run on correct branch (MR 6418)

This works around a situation where pmbootstrap init checks out the
wrong branch and we end up executing the wrong version of the tests.

For context:
https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/6418#note_477266
This commit is contained in:
Clayton Craft 2025-04-15 14:03:40 -07:00
parent 00919cd2c0
commit 7fd9e01f7f
No known key found for this signature in database
GPG key ID: 4A4CED6D7EDF950A

View file

@ -10,6 +10,8 @@ if [ "$(id -u)" = 0 ]; then
set -x
wget "https://gitlab.postmarketos.org/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
sh ./install_pmbootstrap.sh pytest
# FIXME: workaround for pmb init switching the branch on us...
su "${TESTUSER:-pmos}" -c "git -C $CI_PROJECT_DIR checkout $CI_COMMIT_SHA"
exec su "${TESTUSER:-pmos}" -c "sh -e $0"
fi