Skip to content

Commit d6dea0a

Browse files
committed
Inventory: Start setting up integration tests (netbox-community#56)
1 parent c1a6ff7 commit d6dea0a

File tree

6 files changed

+1137
-10
lines changed

6 files changed

+1137
-10
lines changed

.travis.yml

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@ jobs:
2727
- docker-compose pull
2828
- docker-compose up -d
2929
- cd ..
30-
- pip install -U pip
30+
# setuptools <46.1.3 has issues with ansible-test executables https://github.com/ansible/ansible/issues/68963
31+
- pip install -U pip "setuptools>=46.1.3"
3132
# coverage 5.0 is not compatible with ansible-test https://github.com/ansible/ansible/issues/65907
3233
- pip install pytest==4.6.5 pytest-mock pytest-xdist jinja2 PyYAML black==19.10b0 "coverage<5"
33-
- pip install pynetbox cryptography codecov jmespath ansible
34+
- pip install pynetbox cryptography codecov jmespath jsondiff ansible
3435

3536
# Latest release of Netbox and Ansible
3637
- name: "Python 3.6 - Netbox 2.7 - Latest PyPi Ansible"
@@ -44,9 +45,9 @@ jobs:
4445
- docker-compose pull
4546
- docker-compose up -d
4647
- cd ..
47-
- pip install -U pip
48+
- pip install -U pip "setuptools>=46.1.3"
4849
- pip install pytest==4.6.5 pytest-mock pytest-xdist jinja2 PyYAML black==19.10b0 "coverage<5"
49-
- pip install pynetbox cryptography codecov jmespath ansible
50+
- pip install pynetbox cryptography codecov jmespath jsondiff ansible
5051

5152
# Latest development versions of Netbox and Ansible, newest Python
5253
# This may be broken sometimes by changes in the netbox & ansible projects
@@ -62,9 +63,9 @@ jobs:
6263
- docker-compose pull
6364
- docker-compose up -d
6465
- cd ..
65-
- pip install -U pip
66+
- pip install -U pip "setuptools>=46.1.3"
6667
- pip install pytest==4.6.5 pytest-mock pytest-xdist jinja2 PyYAML black==19.10b0 "coverage<5"
67-
- pip install pynetbox cryptography jmespath
68+
- pip install pynetbox cryptography jmespath jsondiff
6869
- git clone https://github.com/ansible/ansible.git
6970
- cd ansible
7071
- source hacking/env-setup
@@ -83,7 +84,7 @@ before_script:
8384
script:
8485
# Perform unit tests on collection from within the installed directory, not the source directory
8586
# Required for imports of other collections (ie. ansible.netcommon) to work correctly
86-
- (cd /home/travis/.ansible/collections/ansible_collections/$COLLECTION_NAMESPACE/$COLLECTION_NAME && ansible-test units --coverage --python $PYTHON_VER -v)
87+
- ansible-test units --coverage --python $PYTHON_VER -v
8788

8889
# Check python syntax
8990
- black . --check --diff
@@ -95,13 +96,18 @@ script:
9596
- python tests/integration/netbox-deploy.py
9697

9798
# Run regression and integration tests
99+
# Run the inventory test first, in case any of the other tests modify the data.
100+
101+
# Run this inventory integration test from the source directory (not the installed directory),
102+
# otherwise runme.sh will not have execute permissions. Should be fixed in Ansible 2.10
103+
# https://github.com/ansible/ansible/issues/68415
104+
- ansible-test integration -vvvv --coverage --local inventory
105+
98106
- ansible-playbook tests/integration/regression-tests.yml -vvvv
99107
- ansible-playbook tests/integration/$VERSION/main.yml -vvvv
100-
- ansible-inventory -vvvv -i tests/integration/test-inventory.yml --list
101-
- ansible-inventory -vvvv -i tests/integration/test-inventory-plurals.yml --list
102108

103109
# Report code coverage
104-
- (cd /home/travis/.ansible/collections/ansible_collections/$COLLECTION_NAMESPACE/$COLLECTION_NAME && ansible-test coverage report)
110+
- ansible-test coverage report
105111

106112
deploy:
107113
provider: script

0 commit comments

Comments
 (0)