CI: Run pytest via script to make it easier to reuse it in python-packaging
This commit is contained in:
parent
2b8d03b0b1
commit
d6993270c2
14
tests/download_data_and_run_pytest.sh
Executable file
14
tests/download_data_and_run_pytest.sh
Executable file
@ -0,0 +1,14 @@
|
||||
#!/usr/bin/bash -eux
|
||||
# Use update-test-sources.sh to update the test data
|
||||
|
||||
# When the tests run in python-rpm-generators,
|
||||
# the structure on disk does not match the dist-git repository.
|
||||
# We apparently must use the standard-test-source role to grab the sources.
|
||||
# OTOH in other packages, we must use fedpkg(-minimal).
|
||||
# The --force flag is required in full-blown fedpkg (the source is unused in spec),
|
||||
# and it is ignored in fedpkg-minimal (all sources are always downloaded).
|
||||
test -f test-sources-*.tar.gz || fedpkg sources --force
|
||||
|
||||
tar -xvf test-sources-*.tar.gz -C ./tests/data/scripts_pythondistdeps/
|
||||
cd tests/
|
||||
python3 -m pytest -vvv
|
@ -33,16 +33,13 @@
|
||||
- console_script:
|
||||
dir: .
|
||||
run: ./console_script.sh
|
||||
- prepare-test-data:
|
||||
dir: .
|
||||
run: tar -xvf test-sources-*.tar.gz -C ./tests/data/scripts_pythondistdeps/
|
||||
- pytest:
|
||||
dir: ./tests
|
||||
# Use update-test-sources.sh to update the test data
|
||||
run: python3 -m pytest -vvv
|
||||
dir: .
|
||||
run: ./download_data_and_run_pytest.sh
|
||||
required_packages:
|
||||
- rpm-build
|
||||
- rpmdevtools
|
||||
- fedpkg-minimal
|
||||
- python3-devel
|
||||
- python3-pip
|
||||
- python3-pytest
|
||||
|
Loading…
Reference in New Issue
Block a user