move library/plugins tests files under tests dir

To avoid unnecessary ansible warnings during playbook execution we can
move the library and plugins test files under a different directory.

[WARNING]: Skipping plugin (plugins/filter/test_ipaddrs_in_ranges.py) as
it seems to be invalid:
cannot import name 'ipaddrs_in_ranges'

Closes: #4656

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
(cherry picked from commit 6ce4fde820)
pull/4694/head
Dimitri Savineau 2019-10-25 15:47:05 -04:00 committed by Guillaume Abrioux
parent b547ad9e71
commit 359abedbb1
5 changed files with 13 additions and 5 deletions

View File

@ -9,5 +9,5 @@ install:
- pip install ansible-lint pytest - pip install ansible-lint pytest
script: script:
- if [[ -n $(grep --exclude-dir=.git -P "\xa0" -r .) ]]; then echo 'NBSP characters found'; exit 1; fi - if [[ -n $(grep --exclude-dir=.git -P "\xa0" -r .) ]]; then echo 'NBSP characters found'; exit 1; fi
- pytest -vvvv library/ plugins/ - pytest -vvvv tests/library/ tests/plugins/filter/
- for i in $(ls -1 roles/); do ANSIBLE_LOG_PATH=/dev/null ansible-lint -x 204 -v roles/$i/; if [ $? -ne 0 ]; then exit 1; fi; done - for i in $(ls -1 roles/); do ANSIBLE_LOG_PATH=/dev/null ansible-lint -x 204 -v roles/$i/; if [ $? -ne 0 ]; then exit 1; fi; done

View File

@ -1,4 +1,6 @@
from . import ceph_crush import sys
sys.path.append('./library')
import ceph_crush
import pytest import pytest

View File

@ -1,6 +1,8 @@
import json import json
import os import os
from . import ceph_key import sys
sys.path.append('./library')
import ceph_key
import mock import mock

View File

@ -1,4 +1,6 @@
from . import ceph_volume import sys
sys.path.append('./library')
import ceph_volume
import mock import mock
import os import os

View File

@ -1,4 +1,6 @@
from . import ipaddrs_in_ranges import sys
sys.path.append('./plugins/filter')
import ipaddrs_in_ranges
filter_plugin = ipaddrs_in_ranges.FilterModule() filter_plugin = ipaddrs_in_ranges.FilterModule()