Debian Codegraph @

test/integration/targets/ansible-test-git/runme.sh

raw
1 #!/usr/bin/env bash
2
3 set -eux -o pipefail
4
5 # tests must be executed outside of the ansible source tree
6 # otherwise ansible-test will test the ansible source instead of the test collection
7 # the temporary directory provided by ansible-test resides within the ansible source tree
8 tmp_dir=$(mktemp -d)
9
10 trap 'rm -rf "${tmp_dir}"' EXIT
11
12 export TEST_DIR
13 export WORK_DIR
14
15 TEST_DIR="$PWD"
16
17 for test in collection-tests/*.sh; do
18 WORK_DIR="${tmp_dir}/$(basename "${test}" ".sh")"
19 mkdir "${WORK_DIR}"
20 echo "**********************************************************************"
21 echo "TEST: ${test}: STARTING"
22 "${test}" "${@}" || (echo "TEST: ${test}: FAILED" && exit 1)
23 echo "TEST: ${test}: PASSED"
24 done