From cba817770e73ff88bcf73452acae10d0bd6f10d0 Mon Sep 17 00:00:00 2001 From: skalthoff <32023561+skalthoff@users.noreply.github.com> Date: Mon, 10 Nov 2025 23:34:11 -0800 Subject: [PATCH] Revert "refactor: enhance screen recording and cleanup logic in Maestro tests" This reverts commit aa4223bec2a91c1945465d1a15149aab5859a9d4. --- .github/workflows/maestro-test.yml | 38 +++++++----------------------- 1 file changed, 9 insertions(+), 29 deletions(-) diff --git a/.github/workflows/maestro-test.yml b/.github/workflows/maestro-test.yml index d45e1706..30547708 100644 --- a/.github/workflows/maestro-test.yml +++ b/.github/workflows/maestro-test.yml @@ -191,7 +191,6 @@ jobs: disable-animations: false avd-name: e2e_emulator script: | - set -eo pipefail echo "๐Ÿ”Ž Listing downloaded artifacts" ls -R artifacts || true @@ -200,42 +199,22 @@ jobs: echo "๐Ÿ“ฆ Installing APK: $(cat apk_path.txt)" adb install -r "$(cat apk_path.txt)" - # Prepare video filename for this matrix test - VIDEO_FILE="${{ matrix.test }}.mp4" - # Start screen recording and persist device path + pid to files. DEVICE_VIDEO_PATH="/sdcard/${{ matrix.test }}.mp4"; echo "${DEVICE_VIDEO_PATH}" > device_video_path.txt; echo "๐ŸŽฅ Starting screen recording at ${DEVICE_VIDEO_PATH}"; adb shell screenrecord --time-limit=1800 "${DEVICE_VIDEO_PATH}" & echo $! > rec.pid - # Always stop and pull recording even if tests fail - cleanup() { - echo "โน Stopping screen recording" - if [ -f rec.pid ]; then - kill -INT "$(cat rec.pid)" || true - fi - # Give time to finalize file - sleep 3 - echo "๐Ÿ“ฅ Pulling video" - if [ -f device_video_path.txt ]; then - adb pull "$(cat device_video_path.txt)" "${VIDEO_FILE}" || true - adb shell rm "$(cat device_video_path.txt)" || true - fi - } - trap cleanup EXIT - echo "๐Ÿš€ Logging in via Maestro" - set +e "$HOME"/.maestro/bin/maestro test maestro/tests/1-login.yaml --env server_address="${SERVER_ADDRESS}" --env username="${USERNAME}" - LOGIN_EXIT=$? echo "๐Ÿงช Running test: ${{ matrix.test }}" "$HOME"/.maestro/bin/maestro test "maestro/tests/${{ matrix.test }}" --env server_address="${SERVER_ADDRESS}" --env username="${USERNAME}" - TEST_EXIT=$? - set -e - # Propagate failure while ensuring cleanup runs via trap - if [ "$LOGIN_EXIT" -ne 0 ] || [ "$TEST_EXIT" -ne 0 ]; then - exit 1 - fi + echo "โน Stopping screen recording" + kill -INT "$(cat rec.pid)" || true + # Give time to finalize file + sleep 3 + echo "๐Ÿ“ฅ Pulling video" + adb pull "$(cat device_video_path.txt)" "${{ matrix.test }}.mp4" || true + adb shell rm "$(cat device_video_path.txt)" || true env: SERVER_ADDRESS: "https://jellyfin.jellify.app" USERNAME: "jerry" @@ -244,4 +223,5 @@ jobs: if: always() with: name: TestResult-${{ matrix.test }} - path: ${{ matrix.test }}.mp4 + path: | + *.mp4