Skip to content

Commit

Permalink
tests(spread): test snap parallel installs
Browse files Browse the repository at this point in the history
  • Loading branch information
lengau committed Oct 15, 2024
1 parent 6b8f9a6 commit 2399ddf
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 1 deletion.
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ pyyaml==6.0.2
referencing==0.35.1
requests==2.32.3
requests-toolbelt==1.0.0
requests-unixsocket==0.4.2
requests-unixsocket2==0.4.2
responses==0.25.3
rpds-py==0.20.0
ruamel-yaml==0.18.6
Expand Down
14 changes: 14 additions & 0 deletions tests/spread/smoketests/parallel-install/charmcraft.yaml
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
31 changes: 31 additions & 0 deletions tests/spread/smoketests/parallel-install/task.yaml
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' ') ]]

0 comments on commit 2399ddf

Please sign in to comment.