Skip to content

Commit

Permalink
Add tox test to validate parser
Browse files Browse the repository at this point in the history
We have an existing test_parser_templates.yaml playbook, lets run it on
every commit to increase our coverage.

Closes: ansible-network#98
Signed-off-by: Paul Belanger <[email protected]>
  • Loading branch information
pabelanger committed Feb 6, 2019
1 parent 8a737c9 commit 7d03ec4
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ansible
2 changes: 2 additions & 0 deletions tests/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
- import_playbook: test_parser_templates.yaml
20 changes: 20 additions & 0 deletions tools/test-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash -ex
# Copyright 2017 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE(pabelanger): Create a symlink for ansible-network.network-engine to keep
# meta/main.yml happy
ln -s ~/src/github.com/ansible-network/network-engine \
~/src/github.com/ansible-network/ansible-network.network-engine
8 changes: 7 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ envlist = linters

[testenv]
install_command = pip install {opts} {packages}
deps = -r{toxinidir}/test-requirements.txt
commands =
ansible-playbook -v -i tests/inventory tests/test.yaml
deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
setenv =
ANSIBLE_CALLBACK_PLUGINS = {envsitepackagesdir}/ara/plugins/callbacks

[testenv:linters]
basepython = python3
Expand Down

0 comments on commit 7d03ec4

Please sign in to comment.