28
28
- docker-compose up -d
29
29
- cd ..
30
30
- pip install -U pip
31
- - pip install pytest==4.6.5 pytest-mock pytest-xdist jinja2 PyYAML black==19.10b0
31
+ # coverage 5.0 is not compatible with ansible-test https://github.com/ansible/ansible/issues/65907
32
+ - pip install pytest==4.6.5 pytest-mock pytest-xdist jinja2 PyYAML black==19.10b0 "coverage<5"
32
33
- pip install pynetbox cryptography codecov jmespath ansible
33
34
34
35
# Latest release of Netbox and Ansible
44
45
- docker-compose up -d
45
46
- cd ..
46
47
- pip install -U pip
47
- - pip install pytest==4.6.5 pytest-mock pytest-xdist jinja2 PyYAML black==19.10b0
48
+ - pip install pytest==4.6.5 pytest-mock pytest-xdist jinja2 PyYAML black==19.10b0 "coverage<5"
48
49
- pip install pynetbox cryptography codecov jmespath ansible
49
50
50
51
# Latest development versions of Netbox and Ansible, newest Python
62
63
- docker-compose up -d
63
64
- cd ..
64
65
- pip install -U pip
65
- - pip install pytest==4.6.5 pytest-mock pytest-xdist jinja2 PyYAML black==19.10b0
66
+ - pip install pytest==4.6.5 pytest-mock pytest-xdist jinja2 PyYAML black==19.10b0 "coverage<5"
66
67
- pip install pynetbox cryptography jmespath
67
68
- git clone https://github.com/ansible/ansible.git
68
69
- cd ansible
@@ -82,7 +83,7 @@ before_script:
82
83
script :
83
84
# Perform unit tests on collection from within the installed directory, not the source directory
84
85
# 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
+ - (cd /home/travis/.ansible/collections/ansible_collections/$COLLECTION_NAMESPACE/$COLLECTION_NAME && ansible-test units --coverage -- python $PYTHON_VER -v)
86
87
87
88
# Check python syntax
88
89
- black . --check --diff
@@ -98,6 +99,9 @@ script:
98
99
- ansible-playbook tests/integration/$VERSION/main.yml -vvvv
99
100
- ansible-inventory -i tests/integration/test-inventory.yml --list
100
101
102
+ # Report code coverage
103
+ - (cd /home/travis/.ansible/collections/ansible_collections/$COLLECTION_NAMESPACE/$COLLECTION_NAME && ansible-test coverage report)
104
+
101
105
deploy :
102
106
provider : script
103
107
skip_cleanup : true
0 commit comments