* MM-43753: Module workspaces Move to module workspaces We make the following changes: - Remove the vendor directory. - Dynamically create the go.work file if it doesn't exist. - Set the MM_SERVER_PATH for enterprise tests. https://mattermost.atlassian.net/browse/MM-43753 ```release-note NONE ``` * Fix missing reference to MM_SERVER_PATH ```release-note NONE ``` * Update test to add another nested dir ```release-note NONE ``` * Have separate script to create go.work file ```release-note NONE ``` Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
34 строки
826 B
Bash
Исполняемый файл
34 строки
826 B
Bash
Исполняемый файл
#!/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
|
|
|
|
echo "Packages to test: $PACKAGES"
|
|
echo "GOFLAGS: $GOFLAGS"
|
|
|
|
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
|