From 3a104b6ae1edea39ea8679ca66e171fbb32e7e2f 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..837d769d74 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_NUM_WORKERS=4 \ tox -e "${{ matrix.environment }}" diff --git a/tox.ini b/tox.ini index 30b1b3b726..e8888be09d 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_NUM_WORKERS}' allowlist_externals = bash