diff --git a/tests/scripts/run_tests.sh b/tests/scripts/run_tests.sh deleted file mode 100755 index fdb2fd5..0000000 --- a/tests/scripts/run_tests.sh +++ /dev/null @@ -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} diff --git a/tests/simple/run_tests.sh b/tests/simple/run_tests.sh new file mode 100755 index 0000000..0fd96f5 --- /dev/null +++ b/tests/simple/run_tests.sh @@ -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} diff --git a/tests/tests.yml b/tests/tests.yml index 55509ba..e1be03f 100644 --- a/tests/tests.yml +++ b/tests/tests.yml @@ -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 }}