@@ -3,7 +3,8 @@ language: python
3
3
services :
4
4
- docker
5
5
6
- sudo : false
6
+ os : linux
7
+ dist : bionic
7
8
8
9
env :
9
10
global :
12
13
- COLLECTION_VERSION : 0.1.10
13
14
- secure : " tE6GtwrRU+Kjobx/94xqR2MqM20pHCnrLcHgPzIHA3npdwuA+GjCBiBLTkEEQM4fUWIfzUTyjSr9bZErm1PTI1GcIRdniTgJ3ZzSSkE7tgeYALB/7xsusB57SlmbBQm2SGwU558uWZ3NHEsi0WTgD8GKZo77OpGX72FZKsVXOz6k2wve51sOtoSVjgCsvWTmZHx4ynGdiA5wFkZfaEcjXECahKtunW+MlB5kpJzkVeLRUEXFMhWlsIYiA5nj8OI/X3Nk9ugh1ribENX9LrjpgrqQ9YariZ8G6py1ONuKZIn2g7xs5kNQ3qL6HL6N7SoUxiwH16CfSyugFaYiMfaxQ4NUVGGRHS4vSGbNIf+gLHcYvP40miI1f/+pntCzqygZMhW73FX2o+KH2OGv09khOl8k1nDg2/XvW0kCc/FU6l+Jp5wCC8H9X2uiULtQpRqts5TzIonlPEzGIpfGFgJ5m54Emhv9gjG1Z5OOyL/qae1Wr+L/uhiFafcglZYh8NHEMWCUCkeqFqR2kDmUMtdgYLD7Q7NdwlL/PSVVs1l7UPiQHlnecQKEHN7CvR3eKByTEmkCKafRYh/JQ9rBt9sZc7aAPVu+w3wWUwbHS4o4vVnmyXvJb1PeJSiuynF7CBo4Qd6qj4YwX8gLK6PylGyaMOp169u6xw1mo5/CX0pJ3x4="
14
15
15
- matrix :
16
+ jobs :
16
17
include :
17
- - name : " Python 3.6 - Netbox 2.5 - Latest PyPi Ansible"
18
+ # Previous release of Netbox, latest release of Ansible
19
+ - name : " Python 3.6 - Netbox 2.6 - Latest PyPi Ansible"
18
20
python : 3.6
19
- env : PYTHON_VER=3.6 VERSION=v2.5
21
+ env : PYTHON_VER=3.6 VERSION=v2.6
20
22
install :
21
23
- cd ..
22
24
# Setup netbox container for integration testing
@@ -29,13 +31,32 @@ matrix:
29
31
- pip install pytest==4.6.5 pytest-mock pytest-xdist jinja2 PyYAML black==19.10b0
30
32
- pip install pynetbox cryptography codecov jmespath ansible
31
33
32
- - name : " Python 3.6 - Netbox 2.6 - Ansible Devel"
34
+ # Latest release of Netbox and Ansible
35
+ - name : " Python 3.6 - Netbox 2.7 - Latest PyPi Ansible"
33
36
python : 3.6
34
- env : PYTHON_VER=3.6 VERSION=v2.6
37
+ env : PYTHON_VER=3.6 VERSION=v2.7
35
38
install :
36
39
- cd ..
37
40
# Setup netbox container for integration testing
38
- - git clone https://github.com/FragmentedPacket/netbox-docker.git
41
+ - git clone https://github.com/netbox-community/netbox-docker.git
42
+ - cd netbox-docker
43
+ - docker-compose pull
44
+ - docker-compose up -d
45
+ - cd ..
46
+ - pip install -U pip
47
+ - pip install pytest==4.6.5 pytest-mock pytest-xdist jinja2 PyYAML black==19.10b0
48
+ - pip install pynetbox cryptography codecov jmespath ansible
49
+
50
+ # Latest development versions of Netbox and Ansible, newest Python
51
+ # This may be broken sometimes by changes in the netbox & ansible projects
52
+ # Failures will be allowed in this build
53
+ - name : " Python 3.8 - Netbox develop-2.8 - Ansible Devel"
54
+ python : 3.8
55
+ env : PYTHON_VER=3.8 VERSION=develop-2.8
56
+ install :
57
+ - cd ..
58
+ # Setup netbox container for integration testing
59
+ - git clone https://github.com/netbox-community/netbox-docker.git
39
60
- cd netbox-docker
40
61
- docker-compose pull
41
62
- docker-compose up -d
@@ -47,6 +68,9 @@ matrix:
47
68
- cd ansible
48
69
- source hacking/env-setup
49
70
- cd ..
71
+ allow_failures :
72
+ # When testing against dev netbox and dev ansible, allow failures
73
+ - env : PYTHON_VER=3.8 VERSION=develop-2.8
50
74
51
75
before_script :
52
76
- mkdir -p ~/ansible_collections/$COLLECTION_NAMESPACE
@@ -56,10 +80,20 @@ before_script:
56
80
- ansible-galaxy collection install $COLLECTION_NAMESPACE-$COLLECTION_NAME-$COLLECTION_VERSION.tar.gz -p /home/travis/.ansible/collections
57
81
58
82
script :
59
- - ansible-test units --python $PYTHON_VER -v
60
- - black . --check
83
+ # Perform unit tests on collection from within the installed directory, not the source directory
84
+ # Required for imports of other collections (ie. ansible.netcommon) to work correctly
85
+ - (cd /home/travis/.ansible/collections/ansible_collections/$COLLECTION_NAMESPACE/$COLLECTION_NAME && ansible-test units --python $PYTHON_VER -v)
86
+
87
+ # Check python syntax
88
+ - black . --check --diff
89
+
90
+ # Wait for Netbox containers to be running
61
91
- timeout 300 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:32768)" != "200" ]]; do echo "waiting for Netbox"; sleep 5; done' || false
92
+
93
+ # Prepare data in Netbox
62
94
- python tests/integration/netbox-deploy.py
95
+
96
+ # Run regression and integration tests
63
97
- ansible-playbook tests/integration/regression-tests.yml -vvvv
64
98
- ansible-playbook tests/integration/integration-tests.yml -vvvv
65
99
- ansible-inventory -i tests/integration/test-inventory.yml --list
0 commit comments