Skip to content

Commit 072d107

Browse files
Fix testing (#28)
1 parent dd38949 commit 072d107

File tree

1 file changed

+33
-55
lines changed

1 file changed

+33
-55
lines changed

.travis.yml

Lines changed: 33 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -13,74 +13,52 @@ env:
1313

1414
matrix:
1515
include:
16-
- name: "Python 3.6 - Netbox 2.5"
16+
- name: "Python 3.6 - Netbox 2.5 - Ansible 2.9RC4"
1717
python: 3.6
18-
env: PYTHON_VER=3.6 VERSION=v2.5
18+
env: PYTHON_VER=3.6 VERSION=v2.5 ANSIBLE_VER=2.9.0rc4
1919
install:
20-
- pip install -U pip
21-
- pip install pytest==4.6.5 pytest-mock pytest-xdist jinja2 PyYAML black==19.3b0
22-
- pip install pynetbox==4.0.6 cryptography codecov
23-
- pip install jmespath
24-
- cd ../../
25-
# This is due to ansible-test only being available within devel branch
26-
- git clone https://github.com/ansible/ansible.git
27-
- cd ansible
28-
- git checkout stable-2.9
29-
- source hacking/env-setup
3020
- cd ..
3121
# Setup netbox container for integration testing
32-
- git clone https://github.com/netbox-community/netbox-docker.git
22+
- git clone https://github.com/FragmentedPacket/netbox-docker.git
3323
- cd netbox-docker
34-
- docker-compose --verbose pull
35-
- docker-compose --verbose up -d
24+
- git checkout startup-dcim-interfaces-2.5
25+
- docker-compose pull
26+
- docker-compose up -d
3627
- cd ..
37-
38-
before_script:
39-
- mkdir -p ~/ansible_collections/$COLLECTION_NAMESPACE
40-
- cp -R FragmentedPacket/$COLLECTION_NAME ~/ansible_collections/$COLLECTION_NAMESPACE/$COLLECTION_NAME
41-
- cd ~/ansible_collections/$COLLECTION_NAMESPACE/$COLLECTION_NAME
42-
- ansible-galaxy collection build .
43-
- ansible-galaxy collection install $COLLECTION_NAMESPACE-$COLLECTION_NAME-$COLLECTION_VERSION.tar.gz -p /home/travis/.ansible/collections
44-
45-
script:
46-
- ansible-test units --python $PYTHON_VER -v
47-
- black . --check
48-
- 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
49-
- python tests/integration/netbox-deploy.py
50-
- ansible-playbook tests/integration/integration-tests.yml -v
28+
- pip install -U pip
29+
- pip install pytest==4.6.5 pytest-mock pytest-xdist jinja2 PyYAML black==19.3b0
30+
- pip install pynetbox==4.0.6 cryptography codecov jmespath ansible==$ANSIBLE_VER
5131

52-
- name: "Python 3.6 - Netbox 2.6"
32+
- name: "Python 3.6 - Netbox Latest - Ansible Devel"
5333
python: 3.6
54-
env: PYTHON_VER=3.6 VERSION=v2.6
34+
env: PYTHON_VER=3.6
5535
install:
36+
- cd ..
37+
# Setup netbox container for integration testing
38+
- git clone https://github.com/netbox-community/netbox-docker.git
39+
- cd netbox-docker
40+
- docker-compose pull
41+
- docker-compose up -d
42+
- cd ..
5643
- pip install -U pip
5744
- pip install pytest==4.6.5 pytest-mock pytest-xdist jinja2 PyYAML black==19.3b0
58-
- pip install pynetbox==4.0.6 cryptography
59-
- pip install jmespath
60-
- cd ../../
45+
- pip install pynetbox==4.0.6 cryptography jmespath
6146
# This is due to ansible-test only being available within devel branch
6247
- git clone https://github.com/ansible/ansible.git
6348
- cd ansible
64-
- git checkout stable-2.9
6549
- source hacking/env-setup
66-
- cd ..
67-
# Setup netbox container for integration testing
68-
- git clone https://github.com/netbox-community/netbox-docker.git
69-
- cd netbox-docker
70-
- docker-compose --verbose pull
71-
- docker-compose --verbose up -d
72-
- cd ..
50+
- cd ..
51+
52+
before_script:
53+
- mkdir -p ~/ansible_collections/$COLLECTION_NAMESPACE
54+
- cp -R $COLLECTION_NAME ~/ansible_collections/$COLLECTION_NAMESPACE/$COLLECTION_NAME
55+
- cd ~/ansible_collections/$COLLECTION_NAMESPACE/$COLLECTION_NAME
56+
- ansible-galaxy collection build .
57+
- ansible-galaxy collection install $COLLECTION_NAMESPACE-$COLLECTION_NAME-$COLLECTION_VERSION.tar.gz -p /home/travis/.ansible/collections
7358

74-
before_script:
75-
- mkdir -p ~/ansible_collections/$COLLECTION_NAMESPACE
76-
- cp -R FragmentedPacket/$COLLECTION_NAME ~/ansible_collections/$COLLECTION_NAMESPACE/$COLLECTION_NAME
77-
- cd ~/ansible_collections/$COLLECTION_NAMESPACE/$COLLECTION_NAME
78-
- ansible-galaxy collection build .
79-
- ansible-galaxy collection install $COLLECTION_NAMESPACE-$COLLECTION_NAME-$COLLECTION_VERSION.tar.gz -p /home/travis/.ansible/collections
80-
81-
script:
82-
- ansible-test units --python $PYTHON_VER -v
83-
- black . --check
84-
- 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
85-
- python tests/integration/netbox-deploy.py
86-
- ansible-playbook tests/integration/integration-tests.yml -v
59+
script:
60+
- ansible-test units --python $PYTHON_VER -v
61+
- black . --check
62+
- 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
63+
- python tests/integration/netbox-deploy.py
64+
- ansible-playbook tests/integration/integration-tests.yml -v

0 commit comments

Comments
 (0)