Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/spread-manual.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion spread.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ prepare: |
else
tests.pkgs remove lxd
fi
snap install lxd --channel=latest/stable
snap install lxd --channel=5.21/stable
Comment thread
lengau marked this conversation as resolved.

# Hold snap refreshes for 24h.
snap set system refresh.hold="$(date --date=tomorrow +%Y-%m-%dT%H:%M:%S%:z)"
Expand Down
4 changes: 2 additions & 2 deletions tests/spread/core22/architectures/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/spread/core22/components-environment/task.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
summary: Test scriptlets variables on core22 with components

restore: |
snapcraft clean
snapcraft clean --destructive-mode
rm -f ./*.snap

execute: |
Expand Down
2 changes: 1 addition & 1 deletion tests/spread/core22/environment/paths/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 3 additions & 1 deletion tests/spread/core22/package-repositories/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

Expand Down
1 change: 1 addition & 0 deletions tests/spread/core22/squid-proxy/task.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/spread/core24-suites/environment/paths/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ systems:

restore: |
cd "../snaps/$SNAP"
snapcraft clean
snapcraft clean --destructive-mode
rm -f ./*.snap

execute: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 3 additions & 1 deletion tests/spread/core24/appstream-desktop/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions tests/spread/core24/craftctl/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions tests/spread/core24/linters-file/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ environment:
restore: |
cd "${SNAP}"
rm -f ./*.snap ./*.assert ./linter_output.txt
snapcraft clean --destructive-mode

execute: |
cd "${SNAP}"
Expand Down
4 changes: 3 additions & 1 deletion tests/spread/core24/package-repositories/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

Expand Down
2 changes: 1 addition & 1 deletion tests/spread/core24/platforms/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions tests/spread/core24/squid-proxy/task.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 4 additions & 1 deletion tests/spread/general/appstream-desktop/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
2 changes: 1 addition & 1 deletion tests/spread/general/grammar/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/spread/general/hooks/generated-hooks/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/spread/general/hooks/project-hooks/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 7 additions & 1 deletion tests/spread/general/pack/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 2 additions & 7 deletions tests/spread/general/package-repositories/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/spread/general/stage-packages/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 7 additions & 1 deletion tests/spread/general/version-git/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading