-
Notifications
You must be signed in to change notification settings - Fork 58
/
spread.yaml
88 lines (77 loc) · 2.72 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
# This spread setup is used to test spread with spread itself. For that, the
# spread interpreting this file is assumed to be working based on prior
# testing, while the spread code being shipped to the remote server is being
# verified for correctness. See the tests to have an idea of how that's done.
# Keep in mind that the logic in task.yaml is supposed to test the *built*
# spread, not the one running the task.yaml logic.
project: spread
environment:
GOVERSION: 1.13.8
GOHOME: /home/test
GOPATH: $GOHOME
PATH: $GOHOME/bin:$PATH
CACHE_DISABLED: $(HOST:[ "$SEND_CACHE" = 1 ] && echo false || echo tests/cache)
backends:
google:
key: "$(HOST: echo $SPREAD_GOOGLE_KEY)"
location: snapd-spread/us-east1-b
halt-timeout: 2h
systems:
- ubuntu-20.04-64:
image: ubuntu-2004-64-virt-enabled
workers: 1
qemu:
systems:
- ubuntu-18.04-64:
username: ubuntu
password: ubuntu
exclude:
- .spread-reuse.yaml
- tests/.spread-reuse.yaml
- $CACHE_DISABLED
path: /home/test/src/github.com/snapcore/spread
suites:
tests/:
summary: Integration tests
prepare: |
DEBS="git qemu-kvm lxd tree"
if ! dpkg -l $DEBS; then
apt update
apt install -y $DEBS
fi
# Cache is only available if SEND_CACHE=1 is set.
mkdir -p tests/cache
# Either use pregenerated spread if exists or build it
if [ -x ./bin/spread ]; then
mkdir -p "$GOHOME/bin"
mv -f ./bin/spread "$GOHOME/bin/spread"
else
# Cache Go deb with: cd tests/cache && godeb download $GOVERSION
if ! dpkg -l go; then
if [ ! -f tests/cache/go_$GOVERSION-*.deb ]; then
(
cd tests/cache
if [ ! -f godeb ]; then
wget https://godeb.s3.amazonaws.com/godeb-amd64.tar.gz
tar xzvf godeb-amd64.tar.gz
fi
./godeb download $GOVERSION
)
fi
dpkg -i tests/cache/go_$GOVERSION-*.deb
fi
go get ./cmd/spread
fi
# Cache is only available if SEND_CACHE=1 is set, follow the steps:
# - Create dest dir: > mkdir tests/cache/lxd-ubuntu-16.04
# - Get image id: > lxc image list
# - Export image: > lxc image export <IAMGE-ID> tests/cache/lxd-ubuntu-16.04
# - Extract metadata: > cd tests/cache/lxd-ubuntu-16.04 && tar -xvf <METADATA-FILE>
if [ -d tests/cache/lxd-ubuntu-16.04 ]; then
if ! lxc image list | grep '16\.04'; then
lxc image import tests/cache/lxd-ubuntu-16.04
fi
fi
# Start lxd instance
lxd init --auto
# vim:ts=4:sw=4:et