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/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)" 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..90565f011d 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 + # 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/core22/manifest/manifest-info-envvars/task.yaml b/tests/spread/core22/manifest/manifest-info-envvars/task.yaml index 4b78fc28fb..648281b76f 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 + # 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/core22/package-repositories/task.yaml b/tests/spread/core22/package-repositories/task.yaml index 917404b5e6..e8e1b3a179 100644 --- a/tests/spread/core22/package-repositories/task.yaml +++ b/tests/spread/core22/package-repositories/task.yaml @@ -11,7 +11,9 @@ environment: 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/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-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..2320f054a1 100644 --- a/tests/spread/core24/appstream-desktop/task.yaml +++ b/tests/spread/core24/appstream-desktop/task.yaml @@ -12,7 +12,9 @@ systems: restore: | cd "${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 rm -f ./*.snap 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/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 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..b8b7ea5b3d 100644 --- a/tests/spread/general/pack/task.yaml +++ b/tests/spread/general/pack/task.yaml @@ -26,8 +26,14 @@ prepare: | echo "compression: ${COMPRESSION}" >> snap/snapcraft.yaml restore: | - rm -rf test-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 --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 697fe1d2c6..3cc8fc3208 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 --use-lxd rm -f ./*.snap #shellcheck source=tests/spread/tools/snapcraft-yaml.sh @@ -30,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 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..09d6e0a9b5 100644 --- a/tests/spread/general/version-git/task.yaml +++ b/tests/spread/general/version-git/task.yaml @@ -19,8 +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.