From 2919f38e86e580749d3915d1efd8560e2a79db07 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 7 Nov 2023 11:43:26 +0100 Subject: [PATCH] tests: run multiple pytests in parallel in the workflow --- .github/workflows/test.yml | 3 ++- tox.ini | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9987f6f8d3..97ed426584 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -32,5 +32,6 @@ jobs: with: image: ghcr.io/osbuild/osbuild-ci:latest-202308241910 run: | - TEST_CATEGORY="${{ matrix.test }}" \ + # XXX: or use "auto" here? + TEST_CATEGORY="${{ matrix.test }}" TEST_WORKERS="-n 4" \ tox -e "${{ matrix.environment }}" diff --git a/tox.ini b/tox.ini index 30b1b3b726..04da534e82 100644 --- a/tox.ini +++ b/tox.ini @@ -13,6 +13,7 @@ labels = description = "run osbuild unit tests" deps = pytest + pytest-xdist jsonschema mako iniparse @@ -26,7 +27,7 @@ passenv = TEST_CATEGORY commands = - bash -c 'python -m pytest --pyargs --rootdir=. {env:TEST_CATEGORY}' + bash -c 'python -m pytest --pyargs --rootdir=. {env:TEST_CATEGORY} {env:TEST_WORKERS}' allowlist_externals = bash