This repository was archived by the owner on Feb 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy path.travis.yml
43 lines (43 loc) · 1.84 KB
/
.travis.yml
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
sudo: required
dist: xenial
language: python
python: 2.7
env:
- UNIT_TEST=1
- AMULET_TEST=gate-basic-trusty
- AMULET_TEST=gate-basic-xenial
- AMULET_TEST=gate-basic-bionic
script:
- if [ ! -z ${UNIT_TEST} ]; then make lint; fi
- if [ ! -z ${UNIT_TEST} ]; then make test; fi
# setup dependencies here to save time on simpler test envs
# upgrade python 2.7 to mitigate juju-deployer ssl.SSLError
# ensure we use lxd snap and get rid of any lxd apt pkgs
# wait for lxd socket to be ready after snap installation
# sudo back to ourself to activate lxd group membership
- if [ ! -z ${AMULET_TEST} ]; then
sudo apt-get -qq update;
sudo apt-get -y --allow-unauthenticated install snapd python-tox libpython2.7 libpython2.7-dev libpython2.7-minimal libpython2.7-stdlib python-crypto python-pkg-resources python-yaml python2.7 python2.7-dev python2.7-minimal;
sudo apt-get -y remove lxc* lxd*;
sudo snap install lxd;
sudo snap install juju --classic;
sudo sh -c 'echo PATH=/snap/bin:$PATH >> /etc/environment';
while [ ! -S /var/snap/lxd/common/lxd/unix.socket ]; do echo "Waiting for LXD socket..."; sleep 0.2; done;
sudo sh -c 'lxd init --auto';
sudo usermod -a -G lxd travis;
sudo su travis -c 'lxc network set lxdbr0 ipv6.address none';
make virtualenv;
fi
- if [ ! -z ${AMULET_TEST} ]; then sudo su travis -c 'juju bootstrap localhost'; fi
- if [ ! -z ${AMULET_TEST} ]; then
sudo su travis -c '. .venv/bin/activate && bundletester -vl DEBUG
--test-pattern "${AMULET_TEST}*"';
fi
- if [ ! -z ${AMULET_TEST} ]; then sudo su travis -c 'juju status'; fi
- if [ ! -z ${AMULET_TEST} ]; then
sudo su travis -c \
'juju ssh mysql/0 sudo cat /var/log/juju/unit-mysql-0.log';
fi
- if [ ! -z ${AMULET_TEST} ]; then
sudo su travis -c 'juju ssh mysql/0 sudo cat /var/log/mysql/error.log';
fi