Files
mattermost/scripts/test.sh
Agniva De Sarker d27d7bc8f7 MM-49485: Set BoardsProduct FF to on by default (#22006)
https://mattermost.atlassian.net/browse/MM-49485

```release-note
Boards will be served as an in-built product from
within Mattermost server instead of a plugin.

If you want to disable this, please set the
MM_FEATUREFLAGS_BoardsProduct env var to "false" (without
                                                  the quotes).

In this mode, the boards plugin will remain disabled.
```
2023-01-09 21:53:07 +05:30

40 lines
951 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
COVERMODE=$8
PACKAGES_COMMA=$(echo $PACKAGES | tr ' ' ',')
export MM_SERVER_PATH=$PWD
export MM_FEATUREFLAGS_BoardsProduct=false
echo "Packages to test: $PACKAGES"
echo "GOFLAGS: $GOFLAGS"
if [[ $GOFLAGS == "-race " && $IS_CI == "true" ]] ;
then
export GOMAXPROCS=4
fi
find . -name 'cprofile*.out' -exec sh -c 'rm "{}"' \;
find . -type d -name data -not -path './data' | xargs rm -rf
$GO test $GOFLAGS -run=$TESTS $TESTFLAGS -v -timeout=$TIMEOUT -covermode=$COVERMODE -coverpkg=$PACKAGES_COMMA -exec $DIR/test-xprog.sh $PACKAGES 2>&1 > >( tee output )
EXIT_STATUS=$?
cat output | $GOBIN/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