From 239a14279d4206d96a568c7171eccae2ce43bd41 Mon Sep 17 00:00:00 2001 From: Dimitri Savineau Date: Thu, 26 Nov 2020 14:59:29 -0500 Subject: [PATCH] tests: add module_utils directory to flake8/pytest This adds the module_utils and associated test directory into the flake8 and pytest workflow configuration. It also moves the ca_common module_utils test file from tests/library to it's own directory tests/module_utils. Signed-off-by: Dimitri Savineau --- .github/workflows/flake8.yml | 4 +++- .github/workflows/pytest.yml | 4 +++- tests/{library => module_utils}/test_ca_common.py | 0 3 files changed, 6 insertions(+), 2 deletions(-) rename tests/{library => module_utils}/test_ca_common.py (100%) diff --git a/.github/workflows/flake8.yml b/.github/workflows/flake8.yml index 6814b2dd1..4d6c704c7 100644 --- a/.github/workflows/flake8.yml +++ b/.github/workflows/flake8.yml @@ -3,8 +3,10 @@ on: pull_request: paths: - 'library/**.py' + - 'module_utils/**.py' - 'tests/conftest.py' - 'tests/library/**.py' + - 'tests/module_utils/**.py' - 'tests/functional/tests/**.py' jobs: build: @@ -17,4 +19,4 @@ jobs: python-version: 3.8 architecture: x64 - run: pip install flake8 - - run: flake8 --max-line-length 160 ./library/ ./tests/library/ ./tests/conftest.py ./tests/functional/tests/ + - run: flake8 --max-line-length 160 ./library/ ./module_utils/ ./tests/library/ ./tests/module_utils/ ./tests/conftest.py ./tests/functional/tests/ diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 2bf351383..63c194c6f 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -3,8 +3,10 @@ on: pull_request: paths: - 'library/**.py' + - 'module_utils/**.py' - 'plugins/filter/**.py' - 'tests/library/**.py' + - 'tests/module_utils/**.py' - 'tests/plugins/filter/**.py' jobs: build: @@ -21,6 +23,6 @@ jobs: python-version: ${{ matrix.python-version }} architecture: x64 - run: pip install -r tests/requirements.txt - - run: pytest --cov=library/ --cov=plugins/filter/ -vvvv tests/library/ tests/plugins/filter/ + - run: pytest --cov=library/ --cov=module_utils/ --cov=plugins/filter/ -vvvv tests/library/ tests/module_utils/ tests/plugins/filter/ env: PYTHONPATH: "$PYTHONPATH:/home/runner/work/ceph-ansible/ceph-ansible/library:/home/runner/work/ceph-ansible/ceph-ansible/module_utils:/home/runner/work/ceph-ansible/ceph-ansible" diff --git a/tests/library/test_ca_common.py b/tests/module_utils/test_ca_common.py similarity index 100% rename from tests/library/test_ca_common.py rename to tests/module_utils/test_ca_common.py -- 2.47.3