github.com/fretkak/mattermost-mattermost-server@v5.11.1+incompatible/scripts/test.sh (about) 1 #!/usr/bin/env bash 2 set -o pipefail 3 4 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" 5 6 GO=$1 7 GOFLAGS=$2 8 PACKAGES=$3 9 TESTS=$4 10 TESTFLAGS=$5 11 12 PACKAGES_COMMA=$(echo $PACKAGES | tr ' ' ',') 13 14 echo "Packages to test: $PACKAGES" 15 find . -name 'cprofile*.out' -exec sh -c 'rm "{}"' \; 16 find . -type d -name data -not -path './vendor/*' | xargs rm -rf 17 18 $GO test $GOFLAGS -run=$TESTS $TESTFLAGS -v -timeout=2000s -covermode=count -coverpkg=$PACKAGES_COMMA -exec $DIR/test-xprog.sh $PACKAGES 2>&1 | tee output 19 EXIT_STATUS=$? 20 21 cat output | $GOPATH/bin/go-junit-report > report.xml 22 rm output 23 find . -name 'cprofile*.out' -exec sh -c 'tail -n +2 {} >> cover.out ; rm "{}"' \; 24 rm -f config/*.crt 25 rm -f config/*.key 26 27 exit $EXIT_STATUS