Feature 'ns primitive'
[osm/N2VC.git] / modules / libjuju / .travis.yml
1 dist: xenial
2 sudo: required
3 language: python
4 cache: pip
5 before_install:
6   - if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]]; then sudo add-apt-repository -y ppa:jonathonf/python-3.6; fi
7   - if [[ $TRAVIS_PYTHON_VERSION == '3.7-dev' ]]; then sudo add-apt-repository -y ppa:deadsnakes/ppa; fi
8   - sudo apt-get update -q
9   - sudo apt-get remove -qy lxd lxd-client
10   - sudo apt-get install snapd libsodium-dev -y
11 install:
12   - sudo snap install lxd || true  # ignore failures so that unit tests will still run, at least
13   - sudo sh -c 'echo PATH=/snap/bin:$PATH >> /etc/environment';
14   - sudo snap install jq || true
15   - sudo snap install juju --classic --$JUJU_CHANNEL || true
16   - sudo snap install juju-wait --classic || true
17   - pip install tox-travis
18 env:
19   global: >
20     TEST_AGENTS='{"agents":[{"url":"https://api.staging.jujucharms.com/identity","username":"libjuju-ci@yellow"}],"key":{"private":"88OOCxIHQNguRG7zFg2y2Hx5Ob0SeVKKBRnjyehverc=","public":"fDn20+5FGyN2hYO7z0rFUyoHGUnfrleslUNtoYsjNSs="}}'
21     PATH="/snap/bin:$PATH"
22
23 matrix:
24   include:
25   - python: 3.6
26     env: JUJU_CHANNEL=edge
27   - python: 3.6
28     env: JUJU_CHANNEL=stable
29   - python: 3.7-dev
30     env: JUJU_CHANNEL=stable
31   - python: 3.7-dev
32     env: JUJU_CHANNEL=edge
33 before_script:
34   # Run lint before performing more expensive operations (fail fast/early)
35   - tox -e lint
36
37   # init lxd for tests
38   - sudo lxd waitready --timeout 30
39   - sudo chmod 666 /var/snap/lxd/common/lxd/unix.socket
40   - lxd init --auto --network-address='[::]' --network-port=8443 --storage-backend=dir
41
42   # Horrible workaround to LP Bug #1738614
43   - sudo mkdir /var/snap/lxd/common/lxd/storage-pools/juju-zfs
44   - lxc storage create juju-zfs dir source=/var/snap/lxd/common/lxd/storage-pools/juju-zfs
45
46 script:
47   - juju bootstrap localhost test --config 'identity-url=https://api.staging.jujucharms.com/identity' --config 'allow-model-access=true'
48   - tox -e py3,integration,serial