From a90c81cbfdd57579ef1f6ac883d1f818b981ec17 Mon Sep 17 00:00:00 2001 From: Cleber Rosa Date: Mon, 2 Dec 2024 16:48:00 -0500 Subject: [PATCH] Reorg module metadata and test directory to avoid namespace clashes Because some tools, such as pylint, will mimic the import of Python modules, they can get confused on the test directory structure, and confuse it with the file containing the module implementation. For instance, because there is currently: autils/archive/ar.py And: tests/autils/archive/ar.py Pylint may consider the later to be the former. Because we don't need the autils component in the tests, and because it's not expected that this repo will contain anything other than module implementations under the "autils" component, the simplest solution is to drop it. For consistency, this also drops it from the metadata directory. Signed-off-by: Cleber Rosa --- .github/workflows/modules-tests.yml | 7 +++++-- metadata/{autils => }/archive/ar.yml | 2 +- tests/{autils => modules}/archive/ar.py | 0 .../{autils => modules}/archive/ar.py.data/guaca.a | 0 .../archive/ar.py.data/hello.deb | Bin .../archive/ar.py.data/hello.rpm | Bin 6 files changed, 6 insertions(+), 3 deletions(-) rename metadata/{autils => }/archive/ar.yml (89%) rename tests/{autils => modules}/archive/ar.py (100%) rename tests/{autils => modules}/archive/ar.py.data/guaca.a (100%) rename tests/{autils => modules}/archive/ar.py.data/hello.deb (100%) rename tests/{autils => modules}/archive/ar.py.data/hello.rpm (100%) diff --git a/.github/workflows/modules-tests.yml b/.github/workflows/modules-tests.yml index 3b78513..bcbbf67 100644 --- a/.github/workflows/modules-tests.yml +++ b/.github/workflows/modules-tests.yml @@ -15,7 +15,7 @@ jobs: run: pip3 install 'avocado-framework<104.0' - name: Run the ar module test - run: ./tests/test_module.py metadata/autils/archive/ar.yml + run: ./tests/test_module.py metadata/archive/ar.yml static-checks: runs-on: ubuntu-latest @@ -26,6 +26,9 @@ jobs: - name: Install Avocado to allow for lint check on Python code under tests directory run: pip3 install 'avocado-framework<104.0' + - name: Include autils directory from source tree into Python's PATH + run: pip3 install . + - name: run static checks uses: avocado-framework/avocado-ci-tools@main with: @@ -55,5 +58,5 @@ jobs: - name: Run API stability tests if: steps.test_changes.outcome == 'failure' - run: ./tests/test_module.py metadata/autils/archive/ar.yml + run: ./tests/test_module.py metadata/archive/ar.yml diff --git a/metadata/autils/archive/ar.yml b/metadata/archive/ar.yml similarity index 89% rename from metadata/autils/archive/ar.yml rename to metadata/archive/ar.yml index 87c9a85..749640c 100644 --- a/metadata/autils/archive/ar.yml +++ b/metadata/archive/ar.yml @@ -12,5 +12,5 @@ supported_platforms: - Fedora 36 - Fedora 37 tests: - - tests/autils/archive/ar.py + - tests/modules/archive/ar.py remote: false diff --git a/tests/autils/archive/ar.py b/tests/modules/archive/ar.py similarity index 100% rename from tests/autils/archive/ar.py rename to tests/modules/archive/ar.py diff --git a/tests/autils/archive/ar.py.data/guaca.a b/tests/modules/archive/ar.py.data/guaca.a similarity index 100% rename from tests/autils/archive/ar.py.data/guaca.a rename to tests/modules/archive/ar.py.data/guaca.a diff --git a/tests/autils/archive/ar.py.data/hello.deb b/tests/modules/archive/ar.py.data/hello.deb similarity index 100% rename from tests/autils/archive/ar.py.data/hello.deb rename to tests/modules/archive/ar.py.data/hello.deb diff --git a/tests/autils/archive/ar.py.data/hello.rpm b/tests/modules/archive/ar.py.data/hello.rpm similarity index 100% rename from tests/autils/archive/ar.py.data/hello.rpm rename to tests/modules/archive/ar.py.data/hello.rpm