This repository has been archived by the owner on Apr 18, 2024. It is now read-only.
forked from canonical/rockcraft
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspread.yaml
129 lines (108 loc) · 3.5 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
117
118
119
120
121
122
123
124
125
126
127
128
project: rockcraft
path: /rockcraft
environment:
PROJECT_PATH: /rockcraft
SNAPD_TESTING_TOOLS: $PROJECT_PATH/tools/external/tools
PATH: /snap/bin:$PATH:$SNAPD_TESTING_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-20.04-64:
workers: 2
storage: 40G
- ubuntu-22.04-64:
workers: 2
storage: 40G
- fedora-37-64:
workers: 2
storage: 40G
prepare: |
# if the 'tools' directory inside the submodule does not exist, then assume the submodule is empty
if [[ ! -d "$SNAPD_TESTING_TOOLS" ]]; then
echo "Cannot run spread because submodule 'snapd-testing-tools' is empty. Fetch with 'git submodule update --init' and rerun spread."
exit 1
fi
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
# 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-37-64" ]; then
tests.pkgs remove lxd lxd-client
else
tests.pkgs remove lxd
fi
snap install lxd --channel=latest/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
if [ "$SPREAD_SYSTEM" = "fedora-37-64" ]; then
# Latest docker snap needs a more recent version of snapd than Fedora ships
# https://github.com/canonical/rockcraft/pull/277
snap install docker --channel=core18/stable
else
snap install docker
fi
# make sure docker is working
retry -n 10 --wait 2 sh -c 'docker run --rm hello-world'
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
# Don't remove the base instance, we want to re-use it between tests
if ! [[ $instance =~ ^base-instance-rockcraft* ]]; then
lxc --project=rockcraft delete --force "$instance"
fi
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
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
tests/spread/large/:
summary: bigger tests that take longer to run
manual: true