From b6cfbab8d1496d23dcec13a2a3a4d30b7b6e44e7 Mon Sep 17 00:00:00 2001 From: Casper Jeukendrup <48658420+cbjeukendrup@users.noreply.github.com> Date: Sat, 5 Oct 2024 21:07:42 +0200 Subject: [PATCH] Fix and simplify VTests The problem: since https://github.com/musescore/MuseScore/pull/24847/commits/8c06059d347b8f08fd63f8a6b5b35d506b01446b#diff-f252e90b5a122a709338e9b2cee849e924dde1962532d6e264600ebdcab7e1ab, libopengl0 is no longer installed, because that should now be packaged as a fallback library in the AppImage. It turned out that the VTests use not an AppImage, but an extracted version of it. There is no good reason for that at the moment. It looks like such reason might have existed initially, when the script was added in https://github.com/musescore/MuseScore/pull/16769/files#diff-4e166fe9387c02737f74001790f7af08bc58111d5bef2ebcc73d0988f8e5b693, namely that the `offscreen` platform plugin had to be added. But now that is packaged with the AppImage by default, so there is no reason anymore to unpack the AppImage. --- .github/workflows/check_visual_tests.yml | 4 +-- buildscripts/ci/vtests/build_and_pack.sh | 31 +----------------------- buildscripts/ci/vtests/generate_pngs.sh | 13 +++++----- 3 files changed, 9 insertions(+), 39 deletions(-) diff --git a/.github/workflows/check_visual_tests.yml b/.github/workflows/check_visual_tests.yml index 3be279ed4ed29..6ad60baaa27f8 100644 --- a/.github/workflows/check_visual_tests.yml +++ b/.github/workflows/check_visual_tests.yml @@ -61,7 +61,7 @@ jobs: name: "Build current" runs-on: ubuntu-20.04 needs: setup - if: needs.setup.outputs.do_run == 'true' # Can't use env: see https://github.com/actions/runner/issues/480 + if: needs.setup.outputs.do_run == 'true' steps: - name: Clone repository uses: actions/checkout@v4 @@ -151,7 +151,7 @@ jobs: path: ./musescore_reference - name: Generate PNGs run: | - xvfb-run ./buildscripts/ci/vtests/generate_pngs.sh + bash ./buildscripts/ci/vtests/generate_pngs.sh env: ASAN_OPTIONS: "detect_leaks=0" - name: Compare PNGs diff --git a/buildscripts/ci/vtests/build_and_pack.sh b/buildscripts/ci/vtests/build_and_pack.sh index 127d33fcc0e9d..90c89b0244fb7 100644 --- a/buildscripts/ci/vtests/build_and_pack.sh +++ b/buildscripts/ci/vtests/build_and_pack.sh @@ -50,38 +50,9 @@ bash ./buildscripts/ci/tools/make_branch_env.sh # =========== Pack ========================== -# Constants -HERE="$(cd "$(dirname "$0")" && pwd)" -ORIGIN_DIR=${PWD} - INSTALL_DIR="$(cat $BUILD_DIR/PREFIX.txt)" # MuseScore was installed here -APP_IMAGE_NAME=MuseScoreTemporary -ARTIFACT_NAME=app +APP_IMAGE_NAME=MuseScore-Studio-vtest # Make AppImage bash ./buildscripts/ci/linux/tools/make_appimage.sh "${INSTALL_DIR}" "${APP_IMAGE_NAME}.AppImage" mv "${INSTALL_DIR}/../${APP_IMAGE_NAME}.AppImage" "${ARTIFACTS_DIR}/" - -cd $ARTIFACTS_DIR - -# Unpack AppImage -APP_DIR="./$ARTIFACT_NAME" -rm -rf "$APP_DIR" -rm -rf squashfs-root -chmod +x "${APP_IMAGE_NAME}.AppImage" -"./${APP_IMAGE_NAME}.AppImage" --appimage-extract - -mv squashfs-root "$APP_DIR" - -# Add run file -cp $HERE/run.in $APP_DIR/run -chmod 775 $APP_DIR/run - -# # Pack to 7z -# 7z a "$ARTIFACT_NAME.7z" "$APP_DIR/*" -# chmod a+rw "$ARTIFACT_NAME.7z" - -# Clean up -rm -f "${APP_IMAGE_NAME}.AppImage" - -cd $ORIGIN_DIR diff --git a/buildscripts/ci/vtests/generate_pngs.sh b/buildscripts/ci/vtests/generate_pngs.sh index 74e2a80129934..845c87156c19e 100755 --- a/buildscripts/ci/vtests/generate_pngs.sh +++ b/buildscripts/ci/vtests/generate_pngs.sh @@ -21,19 +21,18 @@ trap 'echo Generate PNGs failed; exit 1' ERR -REF_BIN=./musescore_reference/app/bin/mscore4portable -CUR_BIN=./musescore_current/app/bin/mscore4portable - sudo apt-get install libegl1 -y +export QT_QPA_PLATFORM=offscreen +REF_BIN=./musescore_reference/MuseScore-Studio-vtest.AppImage chmod +x $REF_BIN -# chmod +x ./musescore_reference/app/bin/crashpad_handler - -chmod +x $CUR_BIN -# chmod +x ./musescore_current/app/bin/crashpad_handler echo reference version: $REF_BIN --long-version + +CUR_BIN=./musescore_current/MuseScore-Studio-vtest.AppImage +chmod +x $CUR_BIN + echo current version: $CUR_BIN --long-version