mirror of
https://github.com/mattermost/mattermost.git
synced 2026-02-11 14:54:34 -05:00
27 lines
736 B
Bash
Executable file
27 lines
736 B
Bash
Executable file
#!/usr/bin/env bash
|
|
set -o pipefail
|
|
|
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
|
|
|
|
GO=$1
|
|
GOFLAGS=$2
|
|
PACKAGES=$3
|
|
TESTS=$4
|
|
TESTFLAGS=$5
|
|
|
|
PACKAGES_COMMA=$(echo $PACKAGES | tr ' ' ',')
|
|
|
|
echo "Packages to test: $PACKAGES"
|
|
find . -name 'cprofile*.out' -exec sh -c 'rm "{}"' \;
|
|
find . -type d -name data -not -path './vendor/*' | xargs rm -rf
|
|
|
|
$GO test $GOFLAGS -run=$TESTS $TESTFLAGS -v -timeout=2000s -covermode=count -coverpkg=$PACKAGES_COMMA -exec $DIR/test-xprog.sh $PACKAGES 2>&1 | tee output
|
|
EXIT_STATUS=$?
|
|
|
|
cat output | $GOPATH/bin/go-junit-report > report.xml
|
|
rm output
|
|
find . -name 'cprofile*.out' -exec sh -c 'tail -n +2 "{}" >> cover.out ; rm "{}"' \;
|
|
rm -f config/*.crt
|
|
rm -f config/*.key
|
|
|
|
exit $EXIT_STATUS
|