-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests(spread): test snap parallel installs
- Loading branch information
Showing
3 changed files
with
46 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
type: charm | ||
name: test-charm | ||
summary: test-charm | ||
description: test-charm | ||
|
||
base: [email protected] | ||
platforms: | ||
amd64: | ||
arm64: | ||
riscv64: | ||
|
||
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,31 @@ | ||
summary: pack a charm with parallel-installed charmcraft versions | ||
|
||
# Run last since we change snapd settings | ||
priority: -10 | ||
|
||
prepare: | | ||
snap install yq | ||
if [[ $(snap get system experimental.parallel-instances) != true ]]; then | ||
snap set system experimental.parallel-instances=true | ||
REBOOT | ||
fi | ||
snap install --classic --channel=latest/candidate charmcraft | ||
snap install --dangerous --classic --name=charmcraft_dev /charmcraft/charmcraft_*.snap | ||
restore: | | ||
if [[ $(snap get system experimental.parallel-instances) == true ]]; then | ||
snap remove charmcraft_dev | ||
snap set system experimental.parallel-instances=false | ||
REBOOT | ||
fi | ||
snap install --classic --dangerous /charmcraft/charmcraft_*.snap | ||
execute: | | ||
# Check that the candidate version used the correct version | ||
charmcraft pack | ||
[[ $(unzip -p *.charm manifest.yaml | yq .charmcraft-version) == $(charmcraft --version | cut -f2 -d' ') ]] | ||
rm *.charm | ||
# Try the dev version | ||
charmcraft_dev pack | ||
[[ $(unzip -p *.charm manifest.yaml | yq .charmcraft-version) == $(charmcraft_dev --version | cut -f2 -d' ') ]] |