Skip to content

Commit

Permalink
Remove references to NetBox (nautobot#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
FragmentedPacket authored Feb 21, 2021
1 parent 13f7469 commit 301e66c
Show file tree
Hide file tree
Showing 296 changed files with 5,766 additions and 6,491 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*.tar.gz
networktocode-nautobot*.tar.gz
__pycache__/
*.pyc
tests/output/*
Expand Down
48 changes: 5 additions & 43 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,54 +10,29 @@ env:
global:
- COLLECTION_NAMESPACE: "networktocode"
- COLLECTION_NAME: "nautobot"
#- COLLECTION_VERSION: "1.0.0"
- COLLECTION_VERSION: "1.0.0"
- secure: "tE6GtwrRU+Kjobx/94xqR2MqM20pHCnrLcHgPzIHA3npdwuA+GjCBiBLTkEEQM4fUWIfzUTyjSr9bZErm1PTI1GcIRdniTgJ3ZzSSkE7tgeYALB/7xsusB57SlmbBQm2SGwU558uWZ3NHEsi0WTgD8GKZo77OpGX72FZKsVXOz6k2wve51sOtoSVjgCsvWTmZHx4ynGdiA5wFkZfaEcjXECahKtunW+MlB5kpJzkVeLRUEXFMhWlsIYiA5nj8OI/X3Nk9ugh1ribENX9LrjpgrqQ9YariZ8G6py1ONuKZIn2g7xs5kNQ3qL6HL6N7SoUxiwH16CfSyugFaYiMfaxQ4NUVGGRHS4vSGbNIf+gLHcYvP40miI1f/+pntCzqygZMhW73FX2o+KH2OGv09khOl8k1nDg2/XvW0kCc/FU6l+Jp5wCC8H9X2uiULtQpRqts5TzIonlPEzGIpfGFgJ5m54Emhv9gjG1Z5OOyL/qae1Wr+L/uhiFafcglZYh8NHEMWCUCkeqFqR2kDmUMtdgYLD7Q7NdwlL/PSVVs1l7UPiQHlnecQKEHN7CvR3eKByTEmkCKafRYh/JQ9rBt9sZc7aAPVu+w3wWUwbHS4o4vVnmyXvJb1PeJSiuynF7CBo4Qd6qj4YwX8gLK6PylGyaMOp169u6xw1mo5/CX0pJ3x4="

jobs:
include:
- name: "Python 3.6 - Netbox 2.10 - Latest PyPi Ansible"
- name: "Python 3.6 - Nautobot - Latest PyPi Ansible"
python: 3.6
env:
- PYTHON_VER=3.6 VERSION=latest INTEGRATION_TESTS=latest
- PYTHON_VER=3.6
install:
- cd ..
# Setup netbox container for integration testing
- git clone https://github.com/netbox-community/netbox-docker.git
- cd netbox-docker
- sed -i 's/SKIP_STARTUP_SCRIPTS=false/SKIP_STARTUP_SCRIPTS=true/' env/netbox.env
- docker-compose pull
- docker-compose up -d
- docker image ls
- docker container ls
- cd ..
- pip install -U pip
- pip install -U pytest
- pip install -U pip "setuptools>=46.1.3"
- pip install pytest-mock pytest-xdist jinja2 PyYAML black==19.10b0 "coverage<5"
- pip install pynetbox cryptography codecov jmespath jsondiff ansible
- pip install poetry
- poetry config virtualenvs.create false && poetry install

before_script:
- mkdir -p ~/ansible_collections/$COLLECTION_NAMESPACE
#- cp -R grimlock-ansible ~/ansible_collections/$COLLECTION_NAMESPACE/$COLLECTION_NAME
#- cd ~/ansible_collections/$COLLECTION_NAMESPACE/$COLLECTION_NAME
- cd grimlock-ansible
- ansible-galaxy collection build .
- ansible-galaxy collection install $COLLECTION_NAMESPACE-$COLLECTION_NAME*.tar.gz -p /home/travis/.ansible/collections

# Run all further tests from within the installed directory
# Required to resolve imports of other collections
- cd /home/travis/.ansible/collections/ansible_collections/$COLLECTION_NAMESPACE/$COLLECTION_NAME

# Set runme.sh execute permissions stripped by ansible-galaxy. Should be fixed in Ansible 2.10
# https://github.com/ansible/ansible/issues/68415
- chmod +x tests/integration/targets/inventory-$INTEGRATION_TESTS/runme.sh
- chmod +x tests/integration/targets/inventory-$INTEGRATION_TESTS/compare_inventory_json.py
- chmod +x tests/integration/render_config.sh

# Run render_config.sh to pass environment variables to integration tests
# https://www.ansible.com/blog/adding-integration-tests-to-ansible-content-collections
- tests/integration/render_config.sh tests/integration/targets/inventory/runme_config.template > tests/integration/targets/inventory-$INTEGRATION_TESTS/runme_config

script:
# Check python syntax
- black . --check --diff
Expand All @@ -69,19 +44,6 @@ script:

# Unit tests, with code coverage
- ansible-test units -v --coverage --python $PYTHON_VER

# Wait for Netbox containers to be running
- 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

# Prepare data in Netbox
- ./tests/integration/netbox-deploy.py

# Run regression and integration tests
# Run the inventory test first, in case any of the other tests modify the data.
- ansible-test integration -v --coverage --python $PYTHON_VER inventory-$INTEGRATION_TESTS
- ansible-test integration -v --coverage --python $PYTHON_VER regression-$INTEGRATION_TESTS
- ansible-test integration -v --coverage --python $PYTHON_VER $INTEGRATION_TESTS

# Report code coverage
- ansible-test coverage report --all --omit "tests/*,hacking/*,docs/*" --show-missing

Expand Down
511 changes: 65 additions & 446 deletions CHANGELOG.rst

Large diffs are not rendered by default.

Loading

0 comments on commit 301e66c

Please sign in to comment.