forked from canonical/snapcraft
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests(remotebuild): add per-base remote-build spread tests
Signed-off-by: Callahan Kovacs <[email protected]>
- Loading branch information
Showing
26 changed files
with
310 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
tests/spread/core20/remote-build-legacy/snaps/all/expected-snaps.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
test-snap-all-core20_1.0_all.snap |
16 changes: 16 additions & 0 deletions
16
tests/spread/core20/remote-build-legacy/snaps/all/snapcraft.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: test-snap-all-core20 | ||
base: core20 | ||
version: "1.0" | ||
summary: Test snap for remote build | ||
description: Test snap for remote build | ||
|
||
grade: stable | ||
confinement: strict | ||
|
||
architectures: | ||
- build-on: [amd64] | ||
run-on: [all] | ||
|
||
parts: | ||
my-part: | ||
plugin: nil |
2 changes: 2 additions & 0 deletions
2
tests/spread/core20/remote-build-legacy/snaps/architectures/expected-snaps.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
test-snap-architectures-core20_1.0_amd64.snap | ||
test-snap-architectures-core20_1.0_arm64.snap |
18 changes: 18 additions & 0 deletions
18
tests/spread/core20/remote-build-legacy/snaps/architectures/snapcraft.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: test-snap-architectures-core20 | ||
base: core20 | ||
version: "1.0" | ||
summary: Test snap for remote build | ||
description: Test snap for remote build | ||
|
||
grade: stable | ||
confinement: strict | ||
|
||
architectures: | ||
- build-on: [amd64] | ||
run-on: [amd64] | ||
- build-on: [arm64] | ||
run-on: [arm64] | ||
|
||
parts: | ||
my-part: | ||
plugin: nil |
1 change: 1 addition & 0 deletions
1
tests/spread/core20/remote-build-legacy/snaps/no-architectures/expected-snaps.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
test-snap-no-architectures-core20_1.0_amd64.snap |
12 changes: 12 additions & 0 deletions
12
tests/spread/core20/remote-build-legacy/snaps/no-architectures/snapcraft.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: test-snap-no-architectures-core20 | ||
base: core20 | ||
version: "1.0" | ||
summary: Test snap for remote build | ||
description: Test snap for remote build | ||
|
||
grade: stable | ||
confinement: strict | ||
|
||
parts: | ||
my-part: | ||
plugin: nil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
summary: Test the legacy remote builder for core20 | ||
manual: true | ||
kill-timeout: 180m | ||
|
||
environment: | ||
LAUNCHPAD_TOKEN: "$(HOST: echo ${LAUNCHPAD_TOKEN})" | ||
SNAP: no-architectures | ||
SNAP/all: all | ||
SNAP/no_architectures: no-architectures | ||
SNAP/architectures: architectures | ||
SNAPCRAFT_REMOTE_BUILD_STRATEGY: force-fallback | ||
CREDENTIALS_FILE: "$HOME/.local/share/snapcraft/launchpad-credentials" | ||
CREDENTIALS_FILE/new_credentials: "$HOME/.local/share/snapcraft/launchpad-credentials" | ||
CREDENTIALS_FILE/old_credentials: "$HOME/.local/share/snapcraft/provider/launchpad/credentials" | ||
|
||
prepare: | | ||
cd "./snaps/$SNAP" | ||
if [[ -z "$LAUNCHPAD_TOKEN" ]]; then | ||
echo "No credentials set in env LAUNCHPAD_TOKEN" | ||
exit 1 | ||
fi | ||
# commit the project | ||
git config --global --add safe.directory "$PWD" | ||
git init | ||
git add snapcraft.yaml | ||
git commit -m "Initial Commit" | ||
# set up launchpad token | ||
mkdir -p "$(dirname "$CREDENTIALS_FILE")" | ||
echo -e "$LAUNCHPAD_TOKEN" >> "$CREDENTIALS_FILE" | ||
restore: | | ||
cd "./snaps/$SNAP" | ||
rm -f ./*.snap ./*.txt | ||
execute: | | ||
cd "./snaps/$SNAP" | ||
snapcraft remote-build --launchpad-accept-public-upload | ||
find . -maxdepth 1 -name "*.snap" | MATCH ".snap" | ||
# confirm the snaps with the expected architectures were built | ||
while read -r expected_snap; do | ||
if [[ ! -e $expected_snap ]]; then | ||
echo "Could not find snap '$expected_snap'" | ||
exit 1 | ||
fi | ||
done < "expected-snaps.txt" | ||
# confirm no other snaps were built | ||
expected_number_of_snaps=$(wc -l < "expected-snaps.txt") | ||
actual_number_of_snaps=$(find . -wholename "./*.snap" | wc -l) | ||
if [[ $expected_number_of_snaps -ne $actual_number_of_snaps ]]; then | ||
echo "Expected $expected_number_of_snaps to be built, but $actual_number_of_snaps were built." | ||
exit 1 | ||
fi |
1 change: 1 addition & 0 deletions
1
tests/spread/core22/remote-build-legacy/snaps/no-architectures/expected-snaps.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
test-snap-no-architectures-core22_1.0_amd64.snap |
12 changes: 12 additions & 0 deletions
12
tests/spread/core22/remote-build-legacy/snaps/no-architectures/snapcraft.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: test-snap-no-architectures-core22 | ||
base: core22 | ||
version: "1.0" | ||
summary: Test snap for remote build | ||
description: Test snap for remote build | ||
|
||
grade: stable | ||
confinement: strict | ||
|
||
parts: | ||
my-part: | ||
plugin: nil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
summary: Test the legacy remote builder for core22 | ||
manual: true | ||
kill-timeout: 180m | ||
|
||
environment: | ||
LAUNCHPAD_TOKEN: "$(HOST: echo ${LAUNCHPAD_TOKEN})" | ||
SNAP: no-architectures | ||
SNAPCRAFT_REMOTE_BUILD_STRATEGY: force-fallback | ||
CREDENTIALS_FILE: "$HOME/.local/share/snapcraft/launchpad-credentials" | ||
CREDENTIALS_FILE/new_credentials: "$HOME/.local/share/snapcraft/launchpad-credentials" | ||
CREDENTIALS_FILE/old_credentials: "$HOME/.local/share/snapcraft/provider/launchpad/credentials" | ||
|
||
prepare: | | ||
cd "./snaps/$SNAP" | ||
if [[ -z "$LAUNCHPAD_TOKEN" ]]; then | ||
echo "No credentials set in env LAUNCHPAD_TOKEN" | ||
exit 1 | ||
fi | ||
# set up launchpad token | ||
mkdir -p "$(dirname "$CREDENTIALS_FILE")" | ||
echo -e "$LAUNCHPAD_TOKEN" >> "$CREDENTIALS_FILE" | ||
restore: | | ||
cd "./snaps/$SNAP" | ||
rm -f ./*.snap ./*.txt | ||
execute: | | ||
cd "./snaps/$SNAP" | ||
snapcraft remote-build --launchpad-accept-public-upload | ||
find . -maxdepth 1 -name "*.snap" | MATCH ".snap" | ||
# confirm the snaps with the expected architectures were built | ||
while read -r expected_snap; do | ||
if [[ ! -e $expected_snap ]]; then | ||
echo "Could not find snap '$expected_snap'" | ||
exit 1 | ||
fi | ||
done < "expected-snaps.txt" | ||
# confirm no other snaps were built | ||
expected_number_of_snaps=$(wc -l < "expected-snaps.txt") | ||
actual_number_of_snaps=$(find . -wholename "./*.snap" | wc -l) | ||
if [[ $expected_number_of_snaps -ne $actual_number_of_snaps ]]; then | ||
echo "Expected $expected_number_of_snaps to be built, but $actual_number_of_snaps were built." | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
test-snap-all-core22_1.0_all.snap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: test-snap-all-core22 | ||
base: core22 | ||
version: "1.0" | ||
summary: Test snap for remote build | ||
description: Test snap for remote build | ||
|
||
grade: stable | ||
confinement: strict | ||
|
||
architectures: | ||
- build-on: [amd64] | ||
build-for: [all] | ||
|
||
parts: | ||
my-part: | ||
plugin: nil |
2 changes: 2 additions & 0 deletions
2
tests/spread/core22/remote-build/snaps/architectures/expected-snaps.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
test-snap-architectures-core22_1.0_amd64.snap | ||
test-snap-architectures-core22_1.0_arm64.snap |
18 changes: 18 additions & 0 deletions
18
tests/spread/core22/remote-build/snaps/architectures/snapcraft.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: test-snap-architectures-core22 | ||
base: core22 | ||
version: "1.0" | ||
summary: Test snap for remote build | ||
description: Test snap for remote build | ||
|
||
grade: stable | ||
confinement: strict | ||
|
||
architectures: | ||
- build-on: [amd64] | ||
build-for: [amd64] | ||
- build-on: [arm64] | ||
build-for: [arm64] | ||
|
||
parts: | ||
my-part: | ||
plugin: nil |
1 change: 1 addition & 0 deletions
1
tests/spread/core22/remote-build/snaps/no-architectures/expected-snaps.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
test-snap-no-architectures-core22_1.0_amd64.snap |
12 changes: 12 additions & 0 deletions
12
tests/spread/core22/remote-build/snaps/no-architectures/snapcraft.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: test-snap-no-architectures-core22 | ||
base: core22 | ||
version: "1.0" | ||
summary: Test snap for remote build | ||
description: Test snap for remote build | ||
|
||
grade: stable | ||
confinement: strict | ||
|
||
parts: | ||
my-part: | ||
plugin: nil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
summary: Test the remote builder for core22 | ||
manual: true | ||
kill-timeout: 180m | ||
|
||
environment: | ||
LAUNCHPAD_TOKEN: "$(HOST: echo ${LAUNCHPAD_TOKEN})" | ||
SNAP: no-architectures | ||
SNAP/all: all | ||
SNAP/no_architectures: no-architectures | ||
SNAP/architectures: architectures | ||
SNAPCRAFT_REMOTE_BUILD_STRATEGY: disable-fallback | ||
CREDENTIALS_FILE: "$HOME/.local/share/snapcraft/launchpad-credentials" | ||
CREDENTIALS_FILE/new_credentials: "$HOME/.local/share/snapcraft/launchpad-credentials" | ||
CREDENTIALS_FILE/old_credentials: "$HOME/.local/share/snapcraft/provider/launchpad/credentials" | ||
|
||
prepare: | | ||
cd "./snaps/$SNAP" | ||
if [[ -z "$LAUNCHPAD_TOKEN" ]]; then | ||
echo "No credentials set in env LAUNCHPAD_TOKEN" | ||
exit 1 | ||
fi | ||
# commit the project | ||
git config --global --add safe.directory "$PWD" | ||
git init | ||
git add snapcraft.yaml | ||
git commit -m "Initial Commit" | ||
# set up launchpad token | ||
mkdir -p "$(dirname "$CREDENTIALS_FILE")" | ||
echo -e "$LAUNCHPAD_TOKEN" >> "$CREDENTIALS_FILE" | ||
restore: | | ||
cd "./snaps/$SNAP" | ||
rm -f ./*.snap ./*.txt | ||
execute: | | ||
cd "./snaps/$SNAP" | ||
snapcraft remote-build --launchpad-accept-public-upload | ||
find . -maxdepth 1 -name "*.snap" | MATCH ".snap" | ||
# confirm the snaps with the expected architectures were built | ||
while read -r expected_snap; do | ||
if [[ ! -e $expected_snap ]]; then | ||
echo "Could not find snap '$expected_snap'" | ||
exit 1 | ||
fi | ||
done < "expected-snaps.txt" | ||
# confirm no other snaps were built | ||
expected_number_of_snaps=$(wc -l < "expected-snaps.txt") | ||
actual_number_of_snaps=$(find . -wholename "./*.snap" | wc -l) | ||
if [[ $expected_number_of_snaps -ne $actual_number_of_snaps ]]; then | ||
echo "Expected $expected_number_of_snaps to be built, but $actual_number_of_snaps were built." | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
tests/spread/core24/remote-build/snaps/no-platforms/snapcraft.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
tests/spread/core24/remote-build/snaps/platforms/snapcraft.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.