Tests: allow site packages in tox to test code depending on 'dnf'

'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 <thozza@redhat.com>
This commit is contained in:
Tomáš Hozza 2024-07-12 10:49:11 +02:00 committed by Simon de Vlieger
parent 67c7d63983
commit 75b6fb4abe

View file

@ -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)"