From c5f1cc7a40b0fb46aa77625c1307952c06fecb0b Mon Sep 17 00:00:00 2001 From: Imani Pelton Date: Wed, 3 Dec 2025 09:06:30 -0500 Subject: [PATCH 1/6] test: properly clean destructive builds in spread tests --- tests/spread/core22/architectures/task.yaml | 4 ++-- tests/spread/core22/components-environment/task.yaml | 2 +- tests/spread/core22/environment/paths/task.yaml | 2 +- .../spread/core22/manifest/manifest-info-cmdline/task.yaml | 5 ++++- .../spread/core22/manifest/manifest-info-envvars/task.yaml | 5 ++++- tests/spread/core22/package-repositories/task.yaml | 6 ++++-- tests/spread/core24-suites/environment/paths/task.yaml | 2 +- .../core24-suites/manifest/manifest-creation/task.yaml | 2 +- .../core24-suites/manifest/manifest-info-envvars/task.yaml | 5 ++++- tests/spread/core24/appstream-desktop/task.yaml | 6 ++++-- tests/spread/core24/craftctl/task.yaml | 1 + tests/spread/core24/linters-file/task.yaml | 1 + tests/spread/core24/package-repositories/task.yaml | 4 +++- tests/spread/core24/platforms/task.yaml | 2 +- tests/spread/general/appstream-desktop/task.yaml | 5 ++++- tests/spread/general/grammar/task.yaml | 2 +- .../general/hooks/generated-and-project-hooks/task.yaml | 2 +- tests/spread/general/hooks/generated-hooks/task.yaml | 2 +- .../general/hooks/generated-then-project-hooks/task.yaml | 2 +- tests/spread/general/hooks/project-hooks-updated/task.yaml | 2 +- tests/spread/general/hooks/project-hooks/task.yaml | 2 +- tests/spread/general/pack/task.yaml | 4 ++++ tests/spread/general/package-repositories/task.yaml | 7 +------ tests/spread/general/stage-packages/task.yaml | 2 +- tests/spread/general/version-git/task.yaml | 4 ++++ 25 files changed, 52 insertions(+), 29 deletions(-) diff --git a/tests/spread/core22/architectures/task.yaml b/tests/spread/core22/architectures/task.yaml index 7f9fe41bf2..8c7c0e745a 100644 --- a/tests/spread/core22/architectures/task.yaml +++ b/tests/spread/core22/architectures/task.yaml @@ -17,7 +17,7 @@ prepare: | restore: | cd "./snaps/$SNAP" - snapcraft clean + snapcraft clean --destructive-mode rm -f ./*.snap #shellcheck source=tests/spread/tools/snapcraft-yaml.sh @@ -34,7 +34,7 @@ execute: | # if the arguments variable file exists, then call snapcraft with the arguments elif [[ -e "arguments.txt" ]]; then # shellcheck disable=SC2046 - eval snapcraft pack --destructive-mode $(cat "arguments.txt") + eval snapcraft pack --destructive-mode $(cat "arguments.txt") # otherwise, just call `snapcraft pack` else snapcraft pack --destructive-mode diff --git a/tests/spread/core22/components-environment/task.yaml b/tests/spread/core22/components-environment/task.yaml index b26d15b78c..58af711f03 100644 --- a/tests/spread/core22/components-environment/task.yaml +++ b/tests/spread/core22/components-environment/task.yaml @@ -1,7 +1,7 @@ summary: Test scriptlets variables on core22 with components restore: | - snapcraft clean + snapcraft clean --destructive-mode rm -f ./*.snap execute: | diff --git a/tests/spread/core22/environment/paths/task.yaml b/tests/spread/core22/environment/paths/task.yaml index 91f4e31bf3..6d788055f6 100644 --- a/tests/spread/core22/environment/paths/task.yaml +++ b/tests/spread/core22/environment/paths/task.yaml @@ -13,7 +13,7 @@ prepare: | restore: | cd "../snaps/$SNAP" - snapcraft clean + snapcraft clean --destructive-mode rm -f ./*.snap #shellcheck source=tests/spread/tools/snapcraft-yaml.sh diff --git a/tests/spread/core22/manifest/manifest-info-cmdline/task.yaml b/tests/spread/core22/manifest/manifest-info-cmdline/task.yaml index 543fd82d82..afdb4a3cbe 100644 --- a/tests/spread/core22/manifest/manifest-info-cmdline/task.yaml +++ b/tests/spread/core22/manifest/manifest-info-cmdline/task.yaml @@ -4,7 +4,10 @@ prepare: | snap install review-tools restore: | - snapcraft clean + # Either of the clean options can potentially fail depending on if/when the test itself failed, but + # they should always both be attempted + snapcraft clean || true + snapcraft clean --destructive-mode || true rm -f ./*.snap rm -f ~/manifest_0.1_*.snap diff --git a/tests/spread/core22/manifest/manifest-info-envvars/task.yaml b/tests/spread/core22/manifest/manifest-info-envvars/task.yaml index 4b78fc28fb..94ff57bf76 100644 --- a/tests/spread/core22/manifest/manifest-info-envvars/task.yaml +++ b/tests/spread/core22/manifest/manifest-info-envvars/task.yaml @@ -4,7 +4,10 @@ prepare: | snap install review-tools restore: | - snapcraft clean + # Either of the clean options can potentially fail depending on if/when the test itself failed, but + # they should always both be attempted + snapcraft clean || true + snapcraft clean --destructive-mode || true rm -f ./*.snap rm -f ~/manifest_0.1_*.snap diff --git a/tests/spread/core22/package-repositories/task.yaml b/tests/spread/core22/package-repositories/task.yaml index 917404b5e6..74021848ba 100644 --- a/tests/spread/core22/package-repositories/task.yaml +++ b/tests/spread/core22/package-repositories/task.yaml @@ -11,8 +11,10 @@ environment: restore: | cd "$SNAP" rm -f ./*.snap - snapcraft clean - snapcraft clean --destructive-mode + # Either of the clean options can potentially fail depending on if/when the test itself failed, but + # they should always both be attempted + snapcraft clean || true + snapcraft clean --destructive-mode || true snap remove "${SNAP}" execute: | diff --git a/tests/spread/core24-suites/environment/paths/task.yaml b/tests/spread/core24-suites/environment/paths/task.yaml index 7bfcd63ba1..ec78b71571 100644 --- a/tests/spread/core24-suites/environment/paths/task.yaml +++ b/tests/spread/core24-suites/environment/paths/task.yaml @@ -11,7 +11,7 @@ systems: restore: | cd "../snaps/$SNAP" - snapcraft clean + snapcraft clean --destructive-mode rm -f ./*.snap execute: | diff --git a/tests/spread/core24-suites/manifest/manifest-creation/task.yaml b/tests/spread/core24-suites/manifest/manifest-creation/task.yaml index b452c6d31f..21beb5629b 100644 --- a/tests/spread/core24-suites/manifest/manifest-creation/task.yaml +++ b/tests/spread/core24-suites/manifest/manifest-creation/task.yaml @@ -11,7 +11,7 @@ prepare: | snap install yq restore: | - snapcraft clean + snapcraft clean --destructive-mode rm -f ./*.snap rm -f ~/manifest_0.1_*.snap rm -f ~/manifest.yaml diff --git a/tests/spread/core24-suites/manifest/manifest-info-envvars/task.yaml b/tests/spread/core24-suites/manifest/manifest-info-envvars/task.yaml index 7f328b4420..1004d459b0 100644 --- a/tests/spread/core24-suites/manifest/manifest-info-envvars/task.yaml +++ b/tests/spread/core24-suites/manifest/manifest-info-envvars/task.yaml @@ -7,7 +7,10 @@ prepare: | snap install review-tools restore: | - snapcraft clean + # The regular clean can potentially fail depending on if/when the test itself failed, but + # they should always both be attempted + snapcraft clean || true + snapcraft clean --destructive-mode rm -f ./*.snap rm -f ~/manifest_0.1_*.snap diff --git a/tests/spread/core24/appstream-desktop/task.yaml b/tests/spread/core24/appstream-desktop/task.yaml index b8a98eff75..0d0672165b 100644 --- a/tests/spread/core24/appstream-desktop/task.yaml +++ b/tests/spread/core24/appstream-desktop/task.yaml @@ -12,8 +12,10 @@ systems: restore: | cd "${SNAP}" - snapcraft clean - snapcraft clean --destructive-mode + # Either of the clean options can potentially fail depending on if/when the test itself failed, but + # they should always both be attempted + snapcraft clean || true + snapcraft clean --destructive-mode || true rm -f ./*.snap execute: | diff --git a/tests/spread/core24/craftctl/task.yaml b/tests/spread/core24/craftctl/task.yaml index 06ffee979f..c5d27247f1 100644 --- a/tests/spread/core24/craftctl/task.yaml +++ b/tests/spread/core24/craftctl/task.yaml @@ -13,6 +13,7 @@ restore: | cd "$SNAP" rm -f ./*.snap rm -Rf work + snapcraft clean --destructive-mode #shellcheck source=tests/spread/tools/snapcraft-yaml.sh . "$TOOLS_DIR/snapcraft-yaml.sh" diff --git a/tests/spread/core24/linters-file/task.yaml b/tests/spread/core24/linters-file/task.yaml index b1a7b11155..e82f6c586e 100644 --- a/tests/spread/core24/linters-file/task.yaml +++ b/tests/spread/core24/linters-file/task.yaml @@ -6,6 +6,7 @@ environment: restore: | cd "${SNAP}" rm -f ./*.snap ./*.assert ./linter_output.txt + snapcraft clean --destructive-mode execute: | cd "${SNAP}" diff --git a/tests/spread/core24/package-repositories/task.yaml b/tests/spread/core24/package-repositories/task.yaml index 3c6247df39..49e7488cab 100644 --- a/tests/spread/core24/package-repositories/task.yaml +++ b/tests/spread/core24/package-repositories/task.yaml @@ -21,7 +21,9 @@ restore: | cd "$SNAP" rm -f ./*.snap - snapcraft clean + # The regular clean can potentially fail depending on if/when the test itself failed, but + # they should always both be attempted + snapcraft clean || true snapcraft clean --destructive-mode snap remove "${SNAP}" diff --git a/tests/spread/core24/platforms/task.yaml b/tests/spread/core24/platforms/task.yaml index a8a237553d..bbecfa032f 100644 --- a/tests/spread/core24/platforms/task.yaml +++ b/tests/spread/core24/platforms/task.yaml @@ -23,7 +23,7 @@ prepare: | restore: | cd "./snaps/$SNAP" - snapcraft clean + snapcraft clean --destructive-mode rm -f ./*.snap #shellcheck source=tests/spread/tools/snapcraft-yaml.sh diff --git a/tests/spread/general/appstream-desktop/task.yaml b/tests/spread/general/appstream-desktop/task.yaml index 28838dc59e..eaa4702f1a 100644 --- a/tests/spread/general/appstream-desktop/task.yaml +++ b/tests/spread/general/appstream-desktop/task.yaml @@ -16,7 +16,10 @@ prepare: | restore: | cd "$SNAP_DIR" - snapcraft clean + # The regular clean can potentially fail depending on if/when the test itself failed, but + # they should always both be attempted + snapcraft clean || true + snapcraft clean --destructive-mode rm -f ./*.snap execute: | diff --git a/tests/spread/general/grammar/task.yaml b/tests/spread/general/grammar/task.yaml index aa57bbab60..aaa2b65f22 100644 --- a/tests/spread/general/grammar/task.yaml +++ b/tests/spread/general/grammar/task.yaml @@ -14,7 +14,7 @@ prepare: | set_base "./snap/snapcraft.yaml" restore: | - snapcraft clean + snapcraft clean --destructive-mode rm -f ./*.snap #shellcheck source=tests/spread/tools/snapcraft-yaml.sh diff --git a/tests/spread/general/hooks/generated-and-project-hooks/task.yaml b/tests/spread/general/hooks/generated-and-project-hooks/task.yaml index 479ae746fc..bdc61a3f7d 100644 --- a/tests/spread/general/hooks/generated-and-project-hooks/task.yaml +++ b/tests/spread/general/hooks/generated-and-project-hooks/task.yaml @@ -8,7 +8,7 @@ prepare: | set_base "./snap/snapcraft.yaml" restore: | - snapcraft clean + snapcraft clean --destructive-mode rm -f ./*.snap #shellcheck source=tests/spread/tools/snapcraft-yaml.sh diff --git a/tests/spread/general/hooks/generated-hooks/task.yaml b/tests/spread/general/hooks/generated-hooks/task.yaml index 9198c657a0..5379f7ef22 100644 --- a/tests/spread/general/hooks/generated-hooks/task.yaml +++ b/tests/spread/general/hooks/generated-hooks/task.yaml @@ -8,7 +8,7 @@ prepare: | set_base "./snap/snapcraft.yaml" restore: | - snapcraft clean + snapcraft clean --destructive-mode rm -f ./*.snap #shellcheck source=tests/spread/tools/snapcraft-yaml.sh diff --git a/tests/spread/general/hooks/generated-then-project-hooks/task.yaml b/tests/spread/general/hooks/generated-then-project-hooks/task.yaml index b82ea73364..cf8639eb56 100644 --- a/tests/spread/general/hooks/generated-then-project-hooks/task.yaml +++ b/tests/spread/general/hooks/generated-then-project-hooks/task.yaml @@ -8,7 +8,7 @@ prepare: | set_base "./snap/snapcraft.yaml" restore: | - snapcraft clean + snapcraft clean --destructive-mode rm -f ./*.snap #shellcheck source=tests/spread/tools/snapcraft-yaml.sh diff --git a/tests/spread/general/hooks/project-hooks-updated/task.yaml b/tests/spread/general/hooks/project-hooks-updated/task.yaml index 53b063baa6..1924a1da0d 100644 --- a/tests/spread/general/hooks/project-hooks-updated/task.yaml +++ b/tests/spread/general/hooks/project-hooks-updated/task.yaml @@ -8,7 +8,7 @@ prepare: | set_base "./snap/snapcraft.yaml" restore: | - snapcraft clean + snapcraft clean --destructive-mode rm -f ./*.snap #shellcheck source=tests/spread/tools/snapcraft-yaml.sh diff --git a/tests/spread/general/hooks/project-hooks/task.yaml b/tests/spread/general/hooks/project-hooks/task.yaml index 73a23b48c3..7c301255b7 100644 --- a/tests/spread/general/hooks/project-hooks/task.yaml +++ b/tests/spread/general/hooks/project-hooks/task.yaml @@ -8,7 +8,7 @@ prepare: | set_base "./snap/snapcraft.yaml" restore: | - snapcraft clean + snapcraft clean --destructive-mode rm -f ./*.snap #shellcheck source=tests/spread/tools/snapcraft-yaml.sh diff --git a/tests/spread/general/pack/task.yaml b/tests/spread/general/pack/task.yaml index 25fb267f7a..b17465fb2e 100644 --- a/tests/spread/general/pack/task.yaml +++ b/tests/spread/general/pack/task.yaml @@ -28,6 +28,10 @@ prepare: | restore: | rm -rf test-snap rm -rf ./*.snap + # The regular clean can potentially fail depending on if/when the test itself failed, but + # they should always both be attempted + snapcraft clean || true + snapcraft clean --destructive-mode execute: | cd test-snap diff --git a/tests/spread/general/package-repositories/task.yaml b/tests/spread/general/package-repositories/task.yaml index 697fe1d2c6..ee14aa24b8 100644 --- a/tests/spread/general/package-repositories/task.yaml +++ b/tests/spread/general/package-repositories/task.yaml @@ -14,12 +14,7 @@ prepare: | restore: | cd "$SNAP" - if [ "$SPREAD_SYSTEM" = "ubuntu-20.04-64" ]; then - snapcraft clean --use-lxd - else - snapcraft clean --destructive-mode - fi - + snapcraft clean rm -f ./*.snap #shellcheck source=tests/spread/tools/snapcraft-yaml.sh diff --git a/tests/spread/general/stage-packages/task.yaml b/tests/spread/general/stage-packages/task.yaml index b2c65fc463..793757aea6 100644 --- a/tests/spread/general/stage-packages/task.yaml +++ b/tests/spread/general/stage-packages/task.yaml @@ -17,7 +17,7 @@ prepare: | restore: | cd "./snaps/$SNAP" - snapcraft clean + snapcraft clean --destructive-mode rm -f ./*.snap #shellcheck source=tests/spread/tools/snapcraft-yaml.sh diff --git a/tests/spread/general/version-git/task.yaml b/tests/spread/general/version-git/task.yaml index 9edcd7d1cf..94875bf6f7 100644 --- a/tests/spread/general/version-git/task.yaml +++ b/tests/spread/general/version-git/task.yaml @@ -21,6 +21,10 @@ prepare: | restore: | rm -rf test-snap rm -rf ./*.snap + # The regular clean can potentially fail depending on if/when the test itself failed, but + # they should always both be attempted + snapcraft clean || true + snapcraft clean --destructive-mode execute: | # Unset SNAPCRAFT_BUILD_ENVIRONMENT=host. From 1bc76e4df099632a05baab556fb9fa9d13e3e7a2 Mon Sep 17 00:00:00 2001 From: Imani Pelton Date: Thu, 4 Dec 2025 13:27:53 -0500 Subject: [PATCH 2/6] test: install lxd 5.21 for spread tests --- spread.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spread.yaml b/spread.yaml index 393758141e..44f1764681 100644 --- a/spread.yaml +++ b/spread.yaml @@ -154,7 +154,7 @@ prepare: | else tests.pkgs remove lxd fi - snap install lxd --channel=latest/stable + snap install lxd --channel=5.21/stable # Hold snap refreshes for 24h. snap set system refresh.hold="$(date --date=tomorrow +%Y-%m-%dT%H:%M:%S%:z)" From f180369934735d91684f9d5e96fa3f3f5e56a815 Mon Sep 17 00:00:00 2001 From: Imani Pelton Date: Thu, 4 Dec 2025 13:35:09 -0500 Subject: [PATCH 3/6] test: mark squid spread tests as flaky --- .github/workflows/spread-manual.yaml | 23 +++++++++++++++++++++++ tests/spread/core22/squid-proxy/task.yaml | 1 + tests/spread/core24/squid-proxy/task.yaml | 1 + 3 files changed, 25 insertions(+) diff --git a/.github/workflows/spread-manual.yaml b/.github/workflows/spread-manual.yaml index 6c50c5bfb0..2b8e7c7db7 100644 --- a/.github/workflows/spread-manual.yaml +++ b/.github/workflows/spread-manual.yaml @@ -225,3 +225,26 @@ jobs: - name: Spread test run: | spread google:ubuntu-20.04-64:tests/spread/snaps/bases google:ubuntu-20.04-64:tests/spread/snaps/snapd + + squid-proxy: + needs: [predicate, snap-build] + if: needs.predicate.outputs.should_run == 'true' + runs-on: [spread-installed] + steps: + - name: Clean up job workspace + run: | + rm -rf "${{ github.workspace }}" + mkdir "${{ github.workspace }}" + - name: Checkout Snapcraft + uses: actions/checkout@v6 + with: + fetch-depth: 0 + submodules: true + - name: Download snap artifact + uses: actions/download-artifact@v6 + with: + name: snap + path: tests + - name: Spread test + run: | + spread google:ubuntu-24.04-64:tests/spread/core24/squid-proxy google:ubuntu-22.04-64:tests/spread/core22/squid-proxy diff --git a/tests/spread/core22/squid-proxy/task.yaml b/tests/spread/core22/squid-proxy/task.yaml index 8c71b0767f..dc026b6366 100644 --- a/tests/spread/core22/squid-proxy/task.yaml +++ b/tests/spread/core22/squid-proxy/task.yaml @@ -1,4 +1,5 @@ summary: Verify that squid proxy can be passed as an http proxy to snapcraft. +manual: true environment: SNAP_DIR: snaps/squid-proxy-test diff --git a/tests/spread/core24/squid-proxy/task.yaml b/tests/spread/core24/squid-proxy/task.yaml index 5346edb310..d80d7365a1 100644 --- a/tests/spread/core24/squid-proxy/task.yaml +++ b/tests/spread/core24/squid-proxy/task.yaml @@ -1,4 +1,5 @@ summary: Verify that squid proxy can be passed as an http proxy to snapcraft. +manual: true environment: SNAP_DIR: snaps/squid-proxy-test From 020ee2715f6b431193aa59f8f0d4abb78a4a8045 Mon Sep 17 00:00:00 2001 From: Imani Pelton Date: Thu, 4 Dec 2025 17:04:22 -0500 Subject: [PATCH 4/6] test: fix a couple of cleaning instances --- tests/spread/general/pack/task.yaml | 8 +++++--- tests/spread/general/package-repositories/task.yaml | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/spread/general/pack/task.yaml b/tests/spread/general/pack/task.yaml index b17465fb2e..b8b7ea5b3d 100644 --- a/tests/spread/general/pack/task.yaml +++ b/tests/spread/general/pack/task.yaml @@ -26,12 +26,14 @@ prepare: | echo "compression: ${COMPRESSION}" >> snap/snapcraft.yaml restore: | - rm -rf test-snap - rm -rf ./*.snap + pushd test-snap # The regular clean can potentially fail depending on if/when the test itself failed, but # they should always both be attempted - snapcraft clean || true + snapcraft clean --use-lxd || true snapcraft clean --destructive-mode + rm -rf ./*.snap + popd + rm -rf test-snap execute: | cd test-snap diff --git a/tests/spread/general/package-repositories/task.yaml b/tests/spread/general/package-repositories/task.yaml index ee14aa24b8..3cc8fc3208 100644 --- a/tests/spread/general/package-repositories/task.yaml +++ b/tests/spread/general/package-repositories/task.yaml @@ -14,7 +14,7 @@ prepare: | restore: | cd "$SNAP" - snapcraft clean + snapcraft clean --use-lxd rm -f ./*.snap #shellcheck source=tests/spread/tools/snapcraft-yaml.sh @@ -25,7 +25,7 @@ execute: | cd "$SNAP" # Build what we have. - snapcraft pack --use-lxd + snapcraft pack --use-lxd # And verify the snap runs as expected. snap install "${SNAP}"_1.0_*.snap --dangerous From 7b755cab1350d2c1923a03d956fe693f94669b65 Mon Sep 17 00:00:00 2001 From: Imani Pelton Date: Thu, 4 Dec 2025 17:05:39 -0500 Subject: [PATCH 5/6] test: fix logic of a couple more spread tests --- tests/spread/core22/manifest/manifest-info-cmdline/task.yaml | 4 ++-- tests/spread/core22/manifest/manifest-info-envvars/task.yaml | 4 ++-- tests/spread/core22/package-repositories/task.yaml | 4 ++-- tests/spread/core24/appstream-desktop/task.yaml | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/spread/core22/manifest/manifest-info-cmdline/task.yaml b/tests/spread/core22/manifest/manifest-info-cmdline/task.yaml index afdb4a3cbe..90565f011d 100644 --- a/tests/spread/core22/manifest/manifest-info-cmdline/task.yaml +++ b/tests/spread/core22/manifest/manifest-info-cmdline/task.yaml @@ -4,10 +4,10 @@ prepare: | snap install review-tools restore: | - # Either of the clean options can potentially fail depending on if/when the test itself failed, but + # The regular clean can potentially fail depending on if/when the test itself failed, but # they should always both be attempted snapcraft clean || true - snapcraft clean --destructive-mode || true + snapcraft clean --destructive-mode rm -f ./*.snap rm -f ~/manifest_0.1_*.snap diff --git a/tests/spread/core22/manifest/manifest-info-envvars/task.yaml b/tests/spread/core22/manifest/manifest-info-envvars/task.yaml index 94ff57bf76..648281b76f 100644 --- a/tests/spread/core22/manifest/manifest-info-envvars/task.yaml +++ b/tests/spread/core22/manifest/manifest-info-envvars/task.yaml @@ -4,10 +4,10 @@ prepare: | snap install review-tools restore: | - # Either of the clean options can potentially fail depending on if/when the test itself failed, but + # The regular clean can potentially fail depending on if/when the test itself failed, but # they should always both be attempted snapcraft clean || true - snapcraft clean --destructive-mode || true + snapcraft clean --destructive-mode rm -f ./*.snap rm -f ~/manifest_0.1_*.snap diff --git a/tests/spread/core22/package-repositories/task.yaml b/tests/spread/core22/package-repositories/task.yaml index 74021848ba..e8e1b3a179 100644 --- a/tests/spread/core22/package-repositories/task.yaml +++ b/tests/spread/core22/package-repositories/task.yaml @@ -11,10 +11,10 @@ environment: restore: | cd "$SNAP" rm -f ./*.snap - # Either of the clean options can potentially fail depending on if/when the test itself failed, but + # The regular clean can potentially fail depending on if/when the test itself failed, but # they should always both be attempted snapcraft clean || true - snapcraft clean --destructive-mode || true + snapcraft clean --destructive-mode snap remove "${SNAP}" execute: | diff --git a/tests/spread/core24/appstream-desktop/task.yaml b/tests/spread/core24/appstream-desktop/task.yaml index 0d0672165b..2320f054a1 100644 --- a/tests/spread/core24/appstream-desktop/task.yaml +++ b/tests/spread/core24/appstream-desktop/task.yaml @@ -12,10 +12,10 @@ systems: restore: | cd "${SNAP}" - # Either of the clean options can potentially fail depending on if/when the test itself failed, but + # The regular clean can potentially fail depending on if/when the test itself failed, but # they should always both be attempted snapcraft clean || true - snapcraft clean --destructive-mode || true + snapcraft clean --destructive-mode rm -f ./*.snap execute: | From bd10d452820927930ba63a59d1e95ead4790681c Mon Sep 17 00:00:00 2001 From: Imani Pelton Date: Fri, 5 Dec 2025 11:36:40 -0500 Subject: [PATCH 6/6] test: fix logic of one more clean step --- tests/spread/general/version-git/task.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/spread/general/version-git/task.yaml b/tests/spread/general/version-git/task.yaml index 94875bf6f7..09d6e0a9b5 100644 --- a/tests/spread/general/version-git/task.yaml +++ b/tests/spread/general/version-git/task.yaml @@ -19,12 +19,14 @@ prepare: | echo >> snap/snapcraft.yaml restore: | - rm -rf test-snap + pushd test-snap rm -rf ./*.snap # The regular clean can potentially fail depending on if/when the test itself failed, but # they should always both be attempted snapcraft clean || true snapcraft clean --destructive-mode + popd + rm -rf test-snap execute: | # Unset SNAPCRAFT_BUILD_ENVIRONMENT=host.