tox,workflow: pass tests to run via tox {posargs} instead of env
Using an environ for passing the tests is a bit of a headache when it comes to quoting which is important when trying to write something like: `-k "not test_stages.py"`. I (personally) also find it slightly nicer/more intuitive to be able to do: ``` $ tox -e py36 -- ./test/mod ``` compared to ``` $ TEST_CATEGORY="./test/mod" tox -e py36 ```
This commit is contained in:
parent
659f1f06f2
commit
5d3dac9fb9
2 changed files with 3 additions and 5 deletions
6
.github/workflows/test.yml
vendored
6
.github/workflows/test.yml
vendored
|
|
@ -54,10 +54,9 @@ jobs:
|
|||
# it to vfs for the local storage skopeo stage test.
|
||||
sed -i 's/overlay/vfs/g' /usr/share/containers/storage.conf # default system config
|
||||
sed -i 's/overlay/vfs/g' /etc/containers/storage.conf || true # potential overrides
|
||||
TEST_CATEGORY="${{ matrix.test }}" \
|
||||
TEST_WORKERS="${{ matrix.env_TEST_WORKERS || env.TEST_WORKERS }}" \
|
||||
OSBUILD_TEST_STORE="${{ env.OSBUILD_TEST_STORE }}" \
|
||||
tox -e "${{ matrix.environment }}"
|
||||
tox -e "${{ matrix.environment }}" -- ${{ matrix.test }}
|
||||
|
||||
v1_manifests:
|
||||
name: "Assembler test (legacy)"
|
||||
|
|
@ -73,7 +72,6 @@ jobs:
|
|||
with:
|
||||
image: ghcr.io/osbuild/osbuild-ci:latest-202308241910
|
||||
run: |
|
||||
TEST_CATEGORY="test.run.test_assemblers" \
|
||||
TEST_WORKERS="${{ env.TEST_WORKERS }}" \
|
||||
OSBUILD_TEST_STORE="${{ env.OSBUILD_TEST_STORE }}" \
|
||||
tox -e "py36"
|
||||
tox -e "py36" -- test.run.test_assemblers
|
||||
|
|
|
|||
2
tox.ini
2
tox.ini
|
|
@ -34,7 +34,7 @@ passenv =
|
|||
TEST_CATEGORY
|
||||
|
||||
commands =
|
||||
bash -c 'python -m pytest -v --pyargs --rootdir=. {env:TEST_CATEGORY} {env:TEST_WORKERS}'
|
||||
python -m pytest -v --pyargs --rootdir=. {posargs}
|
||||
|
||||
allowlist_externals =
|
||||
bash
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue