gating: Test the installed pykickstart package

Test installed package, not the source itself.

Resolves: rhbz#1968762
This commit is contained in:
Brian C. Lane 2021-06-08 15:45:28 -07:00
parent eb7467fc22
commit 41f88aae85
3 changed files with 20 additions and 41 deletions

View File

@ -1,31 +0,0 @@
#!/bin/sh
PATH=/usr/bin
TMPDIR="$(mktemp -d)"
CWD="$(pwd)"
PACKAGE=pykickstart
BRANCH=
# clone the dist-git tree for this package
cd ${TMPDIR}
fedpkg co ${PACKAGE}
cd ${PACKAGE}
[ -z "${BRANCH}" ] || fedpkg switch-branch ${BRANCH}
fedpkg prep
# scramble together the extracted source tree name
SRCDIR="${PACKAGE}-$(grep Version: ${PACKAGE}.spec | cut -d ' ' -f 2)"
# run the tests
cd ${SRCDIR}
make check
CHECK_RET=$?
make test
TEST_RET=$?
RET=$((${CHECK_RET} + ${TEST_RET}))
# clean up and exit
cd ${CWD}
rm -rf ${TMPDIR}
exit ${RET}

15
tests/simple/run_tests.sh Executable file
View File

@ -0,0 +1,15 @@
#!/bin/sh
set -eux
: ${1?"Usage: $0 TESTSDIR"}
TESTSDIR="$1"
SOURCEDIR="${TESTSDIR}/source/"
cd "${SOURCEDIR}" || exit
# Make sure the pykickstart source isn't tested
rm -rf ./pykickstart
# Run the unittests against the installed package
python3 -m unittest -v tests/*py tests/commands/*py tests/tools/*py
RET=$?
exit ${RET}

View File

@ -1,17 +1,12 @@
---
- hosts: localhost
tags:
- classic
roles:
- role: standard-test-source
- role: standard-test-basic
tags:
- classic
required_packages:
- fedpkg
- python3-sphinx
- python3-coverage
- python3-kickstart
tests:
- simple:
dir: scripts/
run: ./run_tests.sh
run: ./run_tests.sh {{ tenv_workdir }}