From 7fd9e01f7f6b70c160bc58d7400cbd58f6fdf6ac Mon Sep 17 00:00:00 2001 From: Clayton Craft Date: Tue, 15 Apr 2025 14:03:40 -0700 Subject: [PATCH] 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 --- .ci/pytest.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.ci/pytest.sh b/.ci/pytest.sh index 2baa8ea17..cd5c2c8e1 100755 --- a/.ci/pytest.sh +++ b/.ci/pytest.sh @@ -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