-
Notifications
You must be signed in to change notification settings - Fork 44
/
spread.yaml
116 lines (98 loc) · 3.02 KB
/
spread.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
project: rockcraft
path: /rockcraft
environment:
PROJECT_PATH: /rockcraft
PATH: /snap/bin:$PATH:$PROJECT_PATH/tools/external/tools:$PROJECT_PATH/tools/spread
include:
- tests/
- tools/
- docs/
- requirements-doc.txt
- requirements-focal.txt
- Makefile
- rockcraft/
backends:
google:
key: '$(HOST: echo "$SPREAD_GOOGLE_KEY")'
location: snapd-spread/us-east1-b
halt-timeout: 2h
systems:
- ubuntu-18.04-64:
workers: 1
storage: 40G
- ubuntu-20.04-64:
workers: 1
storage: 40G
- ubuntu-22.04-64:
workers: 1
storage: 40G
- fedora-36-64:
workers: 1
storage: 40G
prepare: |
if os.query is-ubuntu; then
tempfile="$(mktemp)"
if ! apt-get update > "$tempfile" 2>&1; then
cat "$tempfile"
exit 1
fi
fi
tests.pkgs install snapd
snap wait system seed.loaded
# The /snap directory does not exist in some environments
[ ! -d /snap ] && ln -s /var/lib/snapd/snap /snap
# install docker before lxd, otherwise it will mess up with lxd networking
snap install docker
# make sure docker is working
retry -n 10 --wait 2 sh -c 'docker run --rm hello-world'
# older linux releases have separate packages for lxd and lxc (lxd-client)
if [ "$SPREAD_SYSTEM" = "ubuntu-18.04-64" ] || \
[ "$SPREAD_SYSTEM" = "ubuntu-20.04-64" ] || \
[ "$SPREAD_SYSTEM" = "fedora-36-64" ]; then
tests.pkgs remove lxd lxd-client
else
tests.pkgs remove lxd
fi
snap install lxd --channel=latest/stable
snap refresh lxd --channel=5.9/stable
# Hold snap refreshes for 24h.
snap set system refresh.hold="$(date --date=tomorrow +%Y-%m-%dT%H:%M:%S%:z)"
if ! snap watch --last=auto-refresh?; then
journalctl -xe
fi
if ! snap watch --last=install?; then
journalctl -xe
fi
lxd waitready --timeout=30
lxd init --auto
install_rockcraft
restore-each: |
# Cleanup after each task.
docker system prune -a -f
if lxc project info rockcraft > /dev/null 2>&1 ; then
for instance in $(lxc --project=rockcraft list -c n --format csv); do
lxc --project=rockcraft delete --force "$instance"
done
fi
debug-each: |
# output latest rockcraft log file on test failure
rockcraft_log_file=$(find /root/.local/state/rockcraft/log/ -name 'rockcraft*.log' | sort -n | tail -n1)
if [[ -f $rockcraft_log_file ]]; then
echo -e "rockcraft log file contents:\n----------------------------"
cat "$rockcraft_log_file"
echo "----------------------------"
else
echo "could not find rockcraft log file (this is not necessarily an error)"
fi
suites:
docs/tutorials/code/:
summary: tests basic tutorials from the docs
# Don't run tutorial code in Fedora because of a snapd 2.58 bug
# (https://bugs.launchpad.net/snapd/+bug/2002835)
systems: [-fedora-36-64]
docs/how-to/code/:
summary: tests how-to guides from the docs
systems:
- ubuntu-22.04-64
tests/spread/general/:
summary: tests for rockcraft core functionality