Files
mattermost/server/scripts/test.sh
Jesse Hallam 8194817d54 disable coverage (#23686)
* disable coverage

This reduces runtime of the server test suite from ~30m to ~10m, and as far as I can see: we discarded the coverage output anyway.

* allow morph 60s to migrate when running tests
2023-06-09 12:29:08 +02:00

36 lines
708 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
GOBIN=$6
TIMEOUT=$7
PACKAGES_COMMA=$(echo $PACKAGES | tr ' ' ',')
export MM_SERVER_PATH=$PWD
echo "Packages to test: $PACKAGES"
echo "GOFLAGS: $GOFLAGS"
if [[ $GOFLAGS == "-race " && $IS_CI == "true" ]] ;
then
export GOMAXPROCS=4
fi
find . -type d -name data -not -path './data' | xargs rm -rf
$GO test $GOFLAGS -run=$TESTS $TESTFLAGS -v -timeout=$TIMEOUT -exec $DIR/test-xprog.sh $PACKAGES 2>&1 > >( tee output )
EXIT_STATUS=$?
cat output | $GOBIN/go-junit-report > report.xml
rm output
rm -f config/*.crt
rm -f config/*.key
exit $EXIT_STATUS