From 058eb4d1cd60ca246a3e27eecda2db140dc450a7 Mon Sep 17 00:00:00 2001 From: Till Maas Date: Thu, 6 Jun 2019 09:05:24 +0200 Subject: [PATCH 1/3] tests: Add missing roles symlink --- tests/playbooks/roles | 1 + 1 file changed, 1 insertion(+) create mode 120000 tests/playbooks/roles diff --git a/tests/playbooks/roles b/tests/playbooks/roles new file mode 120000 index 0000000..7b9ade8 --- /dev/null +++ b/tests/playbooks/roles @@ -0,0 +1 @@ +../roles/ \ No newline at end of file From 0cbf94af61f857528ca7be855f69ecfc632fd475 Mon Sep 17 00:00:00 2001 From: Till Maas Date: Wed, 5 Jun 2019 21:55:40 +0200 Subject: [PATCH 2/3] unitests: Move unit tests in separate directory --- tests/tests_unit.yml | 4 ++-- tests/{ => unit}/helpers/ethtool | 0 tests/{ => unit}/test_network_connections.py | 0 tox.ini | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) rename tests/{ => unit}/helpers/ethtool (100%) rename tests/{ => unit}/test_network_connections.py (100%) diff --git a/tests/tests_unit.yml b/tests/tests_unit.yml index f55164e..d41217d 100644 --- a/tests/tests_unit.yml +++ b/tests/tests_unit.yml @@ -34,7 +34,7 @@ local_follow: false loop: - ../library/network_connections.py - - test_network_connections.py + - unit/test_network_connections.py - ../module_utils/network_lsr - name: Create helpers directory @@ -48,7 +48,7 @@ dest: /tmp/test-unit-1/helpers mode: 0755 with_fileglob: - - helpers/* + - unit/helpers/* - name: Check if python2 is available command: python2 --version diff --git a/tests/helpers/ethtool b/tests/unit/helpers/ethtool similarity index 100% rename from tests/helpers/ethtool rename to tests/unit/helpers/ethtool diff --git a/tests/test_network_connections.py b/tests/unit/test_network_connections.py similarity index 100% rename from tests/test_network_connections.py rename to tests/unit/test_network_connections.py diff --git a/tox.ini b/tox.ini index ce40a58..bc20613 100644 --- a/tox.ini +++ b/tox.ini @@ -116,7 +116,7 @@ commands = {posargs} \ library/network_connections.py \ module_utils/network_lsr \ - tests/test_network_connections.py + tests/unit/test_network_connections.py [testenv:flake8] basepython = python2.7 From 9e5150b88de1596aaa534bb60693e7d8a91c0c1f Mon Sep 17 00:00:00 2001 From: Till Maas Date: Wed, 5 Jun 2019 21:57:23 +0200 Subject: [PATCH 3/3] tests_unit.yml: Fix ansible-lint warnings --- tests/tests_unit.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/tests_unit.yml b/tests/tests_unit.yml index d41217d..c6ea4ef 100644 --- a/tests/tests_unit.yml +++ b/tests/tests_unit.yml @@ -7,6 +7,7 @@ command: yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_distribution_major_version }}.noarch.rpm args: warn: false + creates: /etc/yum.repos.d/epel.repo when: - ansible_distribution in ['RedHat', 'CentOS'] - ansible_distribution_major_version in ['6', '7'] @@ -54,6 +55,7 @@ command: python2 --version ignore_errors: true register: python2_available + when: true - name: Run python2 unit tests command: python2 /tmp/test-unit-1/test_network_connections.py --verbose @@ -64,6 +66,7 @@ command: python3 --version ignore_errors: true register: python3_available + when: true - name: Run python3 unit tests command: python3 /tmp/test-unit-1/test_network_connections.py --verbose