File: acceptancetest

package info (click to toggle)
golang-github-gophercloud-gophercloud 1.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 11,416 kB
  • sloc: sh: 99; makefile: 21
file content (42 lines) | stat: -rwxr-xr-x 1,029 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
#
set -x
set -o pipefail

source `dirname $0`/stackenv

timeout="60m"
failed=

if [[ -z "${LOG_DIR}" ]]; then
    echo "LOG_DIR not set, will set a temp directory"
    LOG_DIR=/tmp/devstack-logs
fi
mkdir -p ${LOG_DIR}

if [[ -z "${ACCEPTANCE_TESTS_FILTER}" ]]; then
    ACCEPTANCE_TESTS=($(python <<< "print(' '.join($ACCEPTANCE_TESTS))"))
else
    ACCEPTANCE_TESTS=$(find acceptance/openstack -name '*_test.go' -exec dirname {} \; | sort -n | uniq | grep -P "$ACCEPTANCE_TESTS_FILTER")
    ACCEPTANCE_TESTS=($ACCEPTANCE_TESTS)
fi

if [[ -z $ACCEPTANCE_TESTS ]]; then
    echo "No acceptance tests to run"
    exit 0
fi

for acceptance_test in "${ACCEPTANCE_TESTS[@]}"; do
  go test -v -timeout $timeout -tags "fixtures acceptance" ./${acceptance_test} |& tee -a ${LOG_DIR}/acceptance_tests.log
  # Check the error code after each suite, but do not exit early if a suite failed.
  if [[ $? != 0 ]]; then
    failed=1
  fi
done

# If any of the test suites failed, exit 1
if [[ -n $failed ]]; then
  exit 1
fi

exit 0