From b859cadf3ff1ebb7a7447a4f8eb2fd8e6dec09a2 Mon Sep 17 00:00:00 2001 From: David Cantrell Date: Wed, 19 Dec 2018 09:55:01 -0500 Subject: [PATCH] Add Fedora CI gating tests for pyparted. --- gating.yml | 6 ++++++ tests/scripts/run_tests.sh | 29 +++++++++++++++++++++++++++++ tests/tests.yaml | 15 +++++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 gating.yml create mode 100755 tests/scripts/run_tests.sh create mode 100644 tests/tests.yaml diff --git a/gating.yml b/gating.yml new file mode 100644 index 0000000..d71584a --- /dev/null +++ b/gating.yml @@ -0,0 +1,6 @@ +--- !Policy +product_versions: + - fedora-* +decision_context: bodhi_update_push_testing +rules: + - !PassingTestCaseRule {test_case_name: dist.depcheck} diff --git a/tests/scripts/run_tests.sh b/tests/scripts/run_tests.sh new file mode 100755 index 0000000..21804db --- /dev/null +++ b/tests/scripts/run_tests.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +PATH=/usr/bin +TMPDIR="$(mktemp -d)" +CWD="$(pwd)" + +PACKAGE=pyparted +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 # this runs pylint, which is sometimes wrong/noisy +make test +RET=$? + +# clean up and exit +cd ${CWD} +rm -rf ${TMPDIR} +exit ${RET} diff --git a/tests/tests.yaml b/tests/tests.yaml new file mode 100644 index 0000000..b0c2d13 --- /dev/null +++ b/tests/tests.yaml @@ -0,0 +1,15 @@ +--- + +- hosts: localhost + roles: + - role: standard-test-basic + tags: + - classic + + required_packages: + - fedpkg + + tests: + - simple: + dir: scripts/ + run: run_tests.sh