CI: Run pytest via script to make it easier to reuse it in python-packaging

This commit is contained in:
Miro Hrončok 2023-04-19 14:34:31 +02:00
parent 2b8d03b0b1
commit d6993270c2
2 changed files with 17 additions and 6 deletions

View 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

View File

@ -33,16 +33,13 @@
- console_script: - console_script:
dir: . dir: .
run: ./console_script.sh run: ./console_script.sh
- prepare-test-data:
dir: .
run: tar -xvf test-sources-*.tar.gz -C ./tests/data/scripts_pythondistdeps/
- pytest: - pytest:
dir: ./tests dir: .
# Use update-test-sources.sh to update the test data run: ./download_data_and_run_pytest.sh
run: python3 -m pytest -vvv
required_packages: required_packages:
- rpm-build - rpm-build
- rpmdevtools - rpmdevtools
- fedpkg-minimal
- python3-devel - python3-devel
- python3-pip - python3-pip
- python3-pytest - python3-pytest