From 959ab1ed977e3aa7772f59e759aab2553d2d7ece Mon Sep 17 00:00:00 2001 From: bbhtt Date: Thu, 11 Sep 2025 21:18:53 +0530 Subject: [PATCH] tests: Allow screenshot ref commit test to run offline We disable appstream-compose and instead add some bogus data to the media dir and pass --mirror-screenshot-url so that flatpak-builder commits the screenshot ref. Since appstream-compose is disabled mirror-screenshot-url arg has no effect other than allowing us to commit the bogus screenshot ref. Desktop, metainfo and icon files are also dropped from manifest since they have no use without appstream compose. This is needed to run the test offline as appstream tries to download the screenshots online. --- tests/org.flatpak_builder.gui.json | 16 +++------------- tests/test-builder.sh | 2 +- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/tests/org.flatpak_builder.gui.json b/tests/org.flatpak_builder.gui.json index 723d2c67..e29a2f16 100644 --- a/tests/org.flatpak_builder.gui.json +++ b/tests/org.flatpak_builder.gui.json @@ -3,17 +3,15 @@ "runtime": "org.test.Platform", "sdk": "org.test.Sdk", "command": "hello", + "appstream-compose": false, "modules": [ { "name": "hello_gui", "buildsystem": "simple", "build-commands": [ - "mkdir -p ${FLATPAK_DEST}/bin ${FLATPAK_DEST}/share/metainfo ${FLATPAK_DEST}/share/applications", - "mkdir -p ${FLATPAK_DEST}/share/icons/hicolor/64x64/apps", + "mkdir -p ${FLATPAK_DEST}/bin", "cp -vf hello.sh ${FLATPAK_DEST}/bin/hello", - "cp -vf ${FLATPAK_ID}.metainfo.xml ${FLATPAK_DEST}/share/metainfo/${FLATPAK_ID}.metainfo.xml", - "cp -vf ${FLATPAK_ID}.desktop ${FLATPAK_DEST}/share/applications/${FLATPAK_ID}.desktop", - "cp -vf org.test.Hello.png ${FLATPAK_DEST}/share/icons/hicolor/64x64/apps/${FLATPAK_ID}.png" + "DIR=\"${FLATPAK_DEST}/share/app-info/media/org/flatpak_builder/gui/foobar/icons/64x64\" && mkdir -p \"$DIR\" && cp -vf org.test.Hello.png \"$DIR\"" ], "sources": [ { @@ -23,14 +21,6 @@ "echo \"Hello world, from a sandbox\"" ] }, - { - "type": "file", - "path": "org.flatpak_builder.gui.desktop" - }, - { - "type": "file", - "path": "org.flatpak_builder.gui.metainfo.xml" - }, { "type": "file", "path": "org.test.Hello.png" diff --git a/tests/test-builder.sh b/tests/test-builder.sh index 905601d1..8b22ac8a 100755 --- a/tests/test-builder.sh +++ b/tests/test-builder.sh @@ -141,6 +141,6 @@ ${FLATPAK_BUILDER} --repo=$REPO/repo_sc --force-clean builddir_sc \ org.flatpak_builder.gui.json >&2 ostree --repo=$REPO/repo_sc refs|grep -Eq "^screenshots/$(flatpak --default-arch)$" ostree checkout --repo=$REPO/repo_sc -U screenshots/$(flatpak --default-arch) outdir_sc -find outdir_sc -path "*/screenshots/image-1_orig.png" -type f | grep -q . +find outdir_sc -path "*/icons/64x64/org.test.Hello.png" -type f | grep -q . echo "ok screenshot ref commit"