Skip to content

Commit 80f1ec3

Browse files
committed
tests: bootstrap spread
This is "just enough" spread to run locally considering one has google credentials to run with. Signed-off-by: Sergio Schvezov <[email protected]>
1 parent dbf82a0 commit 80f1ec3

File tree

4 files changed

+78
-0
lines changed

4 files changed

+78
-0
lines changed

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "tools/external"]
2+
path = tools/external
3+
url = https://github.com/snapcore/snapd-testing-tools.git

spread.yaml

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
project: charmcraft
2+
3+
path: /charmcraft
4+
environment:
5+
PROJECT_PATH: /charmcraft
6+
PATH: /snap/bin:$PATH:$PROJECT_PATH/tools/external/tools
7+
8+
backends:
9+
google:
10+
key: '$(HOST: echo "$SPREAD_GOOGLE_KEY")'
11+
location: snapd-spread/us-east1-b
12+
halt-timeout: 2h
13+
systems:
14+
- ubuntu-18.04-64:
15+
workers: 1
16+
storage: 40G
17+
- ubuntu-20.04-64:
18+
workers: 1
19+
storage: 40G
20+
- ubuntu-22.04-64:
21+
workers: 1
22+
storage: 40G
23+
- fedora-35-64:
24+
workers: 1
25+
storage: 40G
26+
27+
prepare: |
28+
set -e
29+
if os.query is-ubuntu; then
30+
tempfile="$(mktemp)"
31+
if ! apt-get update > "$tempfile" 2>&1; then
32+
cat "$tempfile"
33+
exit 1
34+
fi
35+
fi
36+
37+
tests.pkgs install snapd
38+
39+
snap wait system seed.loaded
40+
41+
# The /snap directory does not exist in some environments
42+
[ ! -d /snap ] && ln -s /var/lib/snapd/snap /snap
43+
44+
snap install lxd
45+
46+
# Hold snap refreshes for 24h.
47+
snap set system refresh.hold="$(date --date=tomorrow +%Y-%m-%dT%H:%M:%S%:z)"
48+
if ! snap watch --last=auto-refresh?; then
49+
journalctl -xe
50+
fi
51+
if ! snap watch --last=install?; then
52+
journalctl -xe
53+
fi
54+
55+
lxd waitready --timeout=30
56+
lxd init --auto
57+
58+
if stat /charmcraft/charmcraft_*.snap 2>/dev/null; then
59+
snap install --classic --dangerous /charmcraft/charmcraft_*.snap
60+
else
61+
echo "Expected a snap to exist in /charmcraft/"
62+
exit 1
63+
fi
64+
65+
suites:
66+
tests/spread/commands/:
67+
summary: simple charmcraft commands
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
summary: simple version command probe
2+
3+
execute: |
4+
if ! charmcraft version; then
5+
echo charmcraft version command is not working
6+
exit 1
7+
fi

tools/external

Submodule external added at f46dccb

0 commit comments

Comments
 (0)