From 75b6fb4abe7db6ee314d83ca23aefa6abee45772 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hozza?= Date: Fri, 12 Jul 2024 10:49:11 +0200 Subject: [PATCH] Tests: allow site packages in tox to test code depending on 'dnf' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 'dnf' Python package can't be installed using pip in the tox environment. In order to test the code which uses it, we need to use the system version. Our testing environment uses Fedora as the system, therefore we can reasonably use the system version of 'dnf' only with Python version which is on Fedora. Enable site packages in tox for Python 3.12 when testing osbuild internals. Signed-off-by: Tomáš Hozza --- .github/workflows/test.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6ab1b51a..36d8d73d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -44,9 +44,17 @@ jobs: else # test_assemblers.py is run below TEST_CATEGORY="not test_stages.py and not test_assemblers.py" + + # DNF python package can't be installed using pip in the tox environment. + # We need to use the version from the system to test things. + # Since we are running tests on Fedora, enable site packages only + # for Python version which is available on Fedora. + if [ "${{ matrix.environment }}" == "py312" ]; then + TOX_ARGS="-x testenv.sitepackages=True" + fi fi OSBUILD_TEST_STORE="${{ env.OSBUILD_TEST_STORE }}" \ - tox -e "${{ matrix.environment }}" -- -rs $TEST_WORKERS -k "$TEST_CATEGORY" + tox -e "${{ matrix.environment }}" $TOX_ARGS -- -rs $TEST_WORKERS -k "$TEST_CATEGORY" v1_manifests: name: "Assembler test (legacy)"