forked from canonical/snapcraft
-
Notifications
You must be signed in to change notification settings - Fork 0
/
spread.yaml
511 lines (467 loc) · 13.9 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
project: snapcraft
environment:
# Tell snapcraft to use the current host to build
SNAPCRAFT_BUILD_ENVIRONMENT: "host"
# Generate manifest when building snaps.
SNAPCRAFT_BUILD_INFO: "1"
# If SNAPCRAFT_PACKAGE_TYPE is "snap" and this variable is defined, spread
# will install snapcraft from that channel. Otherwise, it'll look for a snap
# in the source tree. If SNAPCRAFT_PACKAGE_TYPE is "deb" this variable does
# nothing.
SNAPCRAFT_CHANNEL: "$(HOST: echo ${SNAPCRAFT_CHANNEL})"
# Show error tracebacks
SNAPCRAFT_MANAGED_HOST: "yes"
# Disable all Sentry error reporting
SNAPCRAFT_ENABLE_ERROR_REPORTING: "no"
# Print potentially useful debugging info
SNAPCRAFT_ENABLE_DEVELOPER_DEBUG: "yes"
# Ensure that we have the right debian configuration for legacy
DEBIAN_FRONTEND: noninteractive
DEBIAN_PRIORITY: critical
TOOLS_DIR: /snapcraft/tests/spread/tools
# Git environment for commits
GIT_AUTHOR_NAME: "Test User"
GIT_AUTHOR_EMAIL: "[email protected]"
backends:
lxd:
systems:
# -native is added for clarity and for ubuntu-20.04* to match.
- ubuntu-18.04
- ubuntu-20.04
- ubuntu-22.04
google:
key: '$(HOST: echo "$SPREAD_GOOGLE_KEY")'
location: snapd-spread/us-east1-b
halt-timeout: 2h
systems:
- ubuntu-18.04-64:
workers: 18
image: ubuntu-1804-64
- ubuntu-20.04-64:
workers: 6
image: ubuntu-2004-64
storage: 40G
- ubuntu-22.04-64:
workers: 6
image: ubuntu-2204-64
multipass:
type: adhoc
allocate: |
if [ "$SPREAD_SYSTEM" = "ubuntu-18.04-64" ]; then
image="18.04"
instance_name="spread-18-04"
elif [ "$SPREAD_SYSTEM" = "ubuntu-20.04-64" ]; then
image="20.04"
instance_name="spread-20-04"
else
FATAL "$SPREAD_SYSTEM is not supported!"
fi
multipass launch --disk 20G --mem 2G --name "$instance_name" "$image"
# Get the IP from the instance
ip=$(multipass info --format csv "$instance_name" | tail -1 | cut -d\, -f3)
# Enable PasswordAuthertication for root over SSH.
multipass exec "$instance_name" -- \
sudo sh -c "echo root:ubuntu | sudo chpasswd"
multipass exec "$instance_name" -- \
sudo sh -c \
"sed -i /etc/ssh/sshd_config -e 's/^PasswordAuthentication.*/PasswordAuthentication yes/' -e 's/^#PermitRootLogin.*/PermitRootLogin yes/'"
multipass exec "$instance_name" -- \
sudo systemctl restart ssh
ADDRESS "$ip:22"
discard: |
if [ "$SPREAD_SYSTEM" = "ubuntu-18.04-64" ]; then
instance_name="spread-18-04"
elif [ "$SPREAD_SYSTEM" = "ubuntu-20.04-64" ]; then
instance_name="spread-20-04"
else
FATAL "$SPREAD_SYSTEM is not supported!"
fi
multipass delete --purge "$instance_name"
systems:
- ubuntu-18.04-64:
workers: 1
username: root
password: ubuntu
- ubuntu-20.04-64:
workers: 1
username: root
password: ubuntu
- ubuntu-22.04-64:
workers: 1
username: root
password: ubuntu
autopkgtest:
type: adhoc
allocate: |
echo "Allocating ad-hoc $SPREAD_SYSTEM"
if [ -z "${ADT_ARTIFACTS:-}" ]; then
FATAL "adhoc only works inside autopkgtest"
exit 1
fi
echo 'ubuntu ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/99-spread-users
ADDRESS localhost:22
discard: echo "Discarding ad-hoc $SPREAD_SYSTEM"
systems:
# Bionic
- ubuntu-18.04-amd64:
username: ubuntu
password: ubuntu
- ubuntu-18.04-i386:
username: ubuntu
password: ubuntu
- ubuntu-18.04-ppc64el:
username: ubuntu
password: ubuntu
- ubuntu-18.04-armhf:
username: ubuntu
password: ubuntu
- ubuntu-18.04-s390x:
username: ubuntu
password: ubuntu
- ubuntu-18.04-arm64:
username: ubuntu
password: ubuntu
# Focal
- ubuntu-20.04-amd64:
username: ubuntu
password: ubuntu
- ubuntu-20.04-ppc64el:
username: ubuntu
password: ubuntu
- ubuntu-20.04-armhf:
username: ubuntu
password: ubuntu
- ubuntu-20.04-s390x:
username: ubuntu
password: ubuntu
- ubuntu-20.04-arm64:
username: ubuntu
password: ubuntu
# Jammy
- ubuntu-22.04-amd64:
username: ubuntu
password: ubuntu
- ubuntu-22.04-ppc64el:
username: ubuntu
password: ubuntu
- ubuntu-22.04-armhf:
username: ubuntu
password: ubuntu
- ubuntu-22.04-s390x:
username: ubuntu
password: ubuntu
- ubuntu-22.04-arm64:
username: ubuntu
password: ubuntu
exclude: [snaps-cache/]
prepare: |
# This unfortunately cannot be extracted into a standalone script since this
# portion of of YAML runs before the source code has been fetched.
# 'apt-get update' is hanging on security.ubuntu.com with IPv6. Prefer IPv4 over
# IPv6
cat <<EOF > gai.conf
precedence ::1/128 50
precedence ::/0 40
precedence 2002::/16 30
precedence ::/96 20
precedence ::ffff:0:0/96 100
EOF
if ! mv gai.conf /etc/gai.conf; then
echo "/etc/gai.conf is not writable, ubuntu-core system? apt-get update won't"
echo "be affected in that case"
rm -f gai.conf
fi
# Now run 'apt-get update', but don't show output unless it fails. The logs are
# long enough as it is.
tempfile="$(mktemp)"
if ! apt-get update > "$tempfile" 2>&1; then
cat "$tempfile"
exit 1
fi
apt-get install -y snapd
snap install snapd
snap wait system seed.loaded
if [ "$SPREAD_SYSTEM" = "ubuntu-18.04-64" ] || [ "$SPREAD_SYSTEM" = "ubuntu-20.04-64" ]; then
# Remove lxd and lxd-client deb packages as our implementation (pylxd) does not
# nicely handle the snap and deb being installed at the same time.
apt-get remove --purge --yes lxd lxd-client
fi
# Install and setup the lxd snap
snap install lxd
# Add the ubuntu user to the lxd group.
adduser ubuntu lxd
lxd init --auto
# 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
if [ "$SPREAD_SYSTEM" = "ubuntu-18.04-64" ] || [ "$SPREAD_SYSTEM" = "ubuntu-20.04-64" ]; then
/snap/bin/lxd waitready --timeout=30
/snap/bin/lxd init --auto
fi
# If $SNAPCRAFT_CHANNEL is defined, install snapcraft from that channel.
# Otherwise, look for it in /snapcraft/.
if [ -z "$SNAPCRAFT_CHANNEL" ]; then
if stat /snapcraft/tests/*.snap 2>/dev/null; then
snap install --classic --dangerous /snapcraft/tests/*.snap
else
echo "Expected a snap to exist in /snapcraft/tests/. If your intention"\
"was to install from the store, set \$SNAPCRAFT_CHANNEL."
exit 1
fi
else
snap install --classic snapcraft --channel="$SNAPCRAFT_CHANNEL"
fi
pushd /snapcraft
git init
git add .
git commit -m "Testing Commit"
popd
restore-each: |
"$TOOLS_DIR"/restore.sh
suites:
tests/spread/core22/:
summary: core22 specific tests
systems:
- ubuntu-22.04
- ubuntu-22.04-64
- ubuntu-22.04-amd64
- ubuntu-22.04-arm64
- ubuntu-22.04-armhf
- ubuntu-22.04-s390x
- ubuntu-22.04-ppc64el
tests/spread/core22/environment/:
summary: core22 environment tests
systems:
- ubuntu-22.04*
tests/spread/core22/scriptlets/:
summary: core22 scriptlet tests
systems:
- ubuntu-22.04*
tests/spread/core22/manifest/:
summary: core22 manifest tests
systems:
- ubuntu-22.04*
tests/spread/core22/architectures/:
summary: core22 architecture tests
systems:
- ubuntu-22.04
- ubuntu-22.04-64
- ubuntu-22.04-amd64
tests/spread/core22/linters/:
summary: core22 linter tests
environment:
SNAPCRAFT_ENABLE_DEVELOPER_DEBUG: "n"
systems:
- ubuntu-22.04*
# General, core suite
tests/spread/general/:
summary: tests of snapcraft core functionality
tests/spread/general/grammar/:
summary: grammar tests
# run grammar tests on amd64 platforms
systems:
- ubuntu-18.04
- ubuntu-18.04-64
- ubuntu-18.04-amd64
- ubuntu-20.04
- ubuntu-20.04-64
- ubuntu-20.04-amd64
- ubuntu-22.04
- ubuntu-22.04-64
- ubuntu-22.04-amd64
tests/spread/general/hooks/:
summary: tests of snapcraft hook functionality
# General, core suite
tests/spread/cross-compile/:
summary: tests of supported cross-compile functionality
systems:
- ubuntu-20.04
- ubuntu-20.04-64
- ubuntu-20.04-amd64
# Use of multipass and lxd build providers
tests/spread/providers/:
summary: tests of snapcraft using build providers
systems:
- ubuntu-18.04-64
- ubuntu-20.04-64
- ubuntu-22.04-64
kill-timeout: 180m
warn-timeout: 9m # Keep less than 10 minutes so Travis can't timeout
priority: 90 # Run this test relatively early since fetching images can take time
tests/spread/providers/legacy/:
summary: tests of snapcraft using build providers
systems:
- ubuntu-18.04-64
- ubuntu-20.04-64
kill-timeout: 180m
warn-timeout: 9m # Keep less than 10 minutes so Travis can't timeout
priority: 90 # Run this test relatively early since fetching images can take time
# Plugin-specific suites
tests/spread/plugins/v1/ant/:
summary: tests of snapcraft's Ant plugin
systems:
- ubuntu-18.04*
tests/spread/plugins/v1/autotools/:
summary: tests of snapcraft's Autotools plugin
systems:
- ubuntu-18.04*
tests/spread/plugins/v1/catkin/:
summary: tests of snapcraft's Catkin plugin
systems:
- ubuntu-18.04
- ubuntu-18.04-64
- ubuntu-18.04-amd64
- ubuntu-18.04-arm64
- ubuntu-18.04-armhf
kill-timeout: 180m
tests/spread/plugins/v1/colcon/:
summary: tests of snapcraft's Colcon plugin
systems:
- ubuntu-18.04
- ubuntu-18.04-64
- ubuntu-18.04-amd64
- ubuntu-18.04-arm64
- ubuntu-18.04-armhf
kill-timeout: 180m
tests/spread/plugins/v1/conda/:
summary: tests of snapcraft's Conda plugin
systems:
- ubuntu-18.04
- ubuntu-18.04-64
tests/spread/plugins/v1/cmake/:
summary: tests of snapcraft's CMake plugin
systems:
- ubuntu-18.04*
tests/spread/plugins/v1/crystal/:
summary: tests of snapcraft's Crystal plugin
systems:
- ubuntu-18.04
- ubuntu-18.04-64
- ubuntu-18.04-amd64
tests/spread/plugins/v1/dotnet/:
summary: tests of snapcraft's Dotnet plugin
systems:
- ubuntu-18.04
- ubuntu-18.04-64
- ubuntu-18.04-amd64
tests/spread/plugins/v1/flutter/:
summary: tests of snapcraft's Flutter plugin
# Keep this 18.04 as the tests makes use of the GNOME 3.28 extension.
systems:
- ubuntu-18.04
- ubuntu-18.04-64
- ubuntu-18.04-amd64
tests/spread/plugins/v1/go/:
summary: tests of snapcraft's Go plugin
systems:
- ubuntu-18.04*
tests/spread/plugins/v1/godeps/:
summary: tests of snapcraft's Godeps plugin
systems:
- ubuntu-18.04*
tests/spread/plugins/v1/gradle/:
summary: tests of snapcraft's Gradle plugin
systems:
- ubuntu-18.04*
priority: 50 # Run this test early so we're not waiting for it
kill-timeout: 40m
warn-timeout: 9m # Keep less than 10 minutes so Travis can't timeout
tests/spread/plugins/v1/kbuild/:
summary: tests of snapcraft's Kbuild plugin
systems:
- ubuntu-18.04*
tests/spread/plugins/v1/make/:
summary: tests of snapcraft's Make plugin
systems:
- ubuntu-18.04*
tests/spread/plugins/v1/maven/:
summary: tests of snapcraft's Maven plugin
systems:
- ubuntu-18.04*
tests/spread/plugins/v1/meson/:
summary: tests of snapcraft's Meson plugin
systems:
- ubuntu-18.04*
tests/spread/plugins/v1/nodejs/:
summary: tests of snapcraft's Nodejs plugin
systems:
- ubuntu-18.04*
tests/spread/plugins/v1/nil/:
summary: tests of snapcraft's Nil plugin
systems:
- ubuntu-18.04*
tests/spread/plugins/v1/plainbox/:
summary: tests of snapcraft's Plainbox plugin
systems:
- ubuntu-18.04*
kill-timeout: 20m
warn-timeout: 9m # Keep less than 10 minutes so Travis can't timeout
tests/spread/plugins/v1/python/:
summary: tests of snapcraft's Python plugin
systems:
- ubuntu-18.04*
tests/spread/plugins/v1/qmake/:
summary: tests of snapcraft's qmake plugin
systems:
- ubuntu-18.04*
tests/spread/plugins/v1/ruby/:
summary: tests of snapcraft's Ruby plugin
systems:
- ubuntu-18.04*
kill-timeout: 180m
tests/spread/plugins/v1/rust/:
summary: tests of snapcraft's Rust plugin
systems:
- ubuntu-18.04
- ubuntu-18.04-64
- ubuntu-18.04-amd64
- ubuntu-18.04-i386
- ubuntu-18.04-armhf
- ubuntu-18.04-s390x
tests/spread/plugins/v1/scons/:
summary: tests of snapcraft's SCons plugin
systems:
- ubuntu-18.04*
tests/spread/plugins/v1/waf/:
summary: tests of snapcraft's Waf plugin
systems:
- ubuntu-18.04*
tests/spread/plugins/v1/x-local/:
summary: tests of snapcraft's local plugins
systems:
- ubuntu-18.04*
tests/spread/plugins/v2/:
summary: tests of snapcraft's v2 plugins
systems:
- ubuntu-20.04*
tests/spread/plugins/craft-parts/:
summary: tests of snapcraft's craft-part's based plugins
systems:
- ubuntu-22.04*
# Extensions tests
tests/spread/extensions/:
summary: tests of snapcraft's extensions
kill-timeout: 20m
# External snap tests
tests/spread/snaps/:
environment:
SNAPCRAFT_BUILD_ENVIRONMENT: ""
manual: true
summary: external snaps
prepare: |
sudo apt-get install git
sudo apt-mark auto git
# Electron builder tests
tests/spread/electron-builder/:
summary: electron-builder tests
path: /snapcraft/
include:
- tests/
- requirements.txt
- requirements-devel.txt
- runtests.sh