Debian Codegraph @

ansible_collections/hetzner/hcloud/.azure-pipelines/scripts/run-tests.sh

raw symbols SCIP
1 #!/usr/bin/env bash
2 # Configure the test environment and run the tests.
3
4 set -o pipefail -eu
5
6 entry_point="$1"
7 entry_point_args="$2"
8 read -r -a coverage_branches <<< "$3" # space separated list of branches to run code coverage on for scheduled builds
9
10 export COMMIT_MESSAGE
11 export COMPLETE
12 export COVERAGE
13 export IS_PULL_REQUEST
14
15 if [ "${SYSTEM_PULLREQUEST_TARGETBRANCH:-}" ]; then
16 IS_PULL_REQUEST=true
17 COMMIT_MESSAGE=$(git log --format=%B -n 1 HEAD^2)
18 else
19 IS_PULL_REQUEST=false
20 COMMIT_MESSAGE=$(git log --format=%B -n 1 HEAD)
21 fi
22
23 COMPLETE=false
24 COVERAGE=false
25
26 if [ "${BUILD_REASON}" = "Schedule" ]; then
27 COMPLETE=true
28
29 if printf '%s\n' "${coverage_branches[@]}" | grep -q "^${BUILD_SOURCEBRANCHNAME}$"; then
30 COVERAGE=true
31 fi
32 fi
33
34 "${entry_point}" "${entry_point_args}" 2>&1 | "$(dirname "$0")/time-command.py"