* 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>
Этот коммит содержится в:
Agniva De Sarker
2022-05-05 21:42:31 +05:30
коммит произвёл GitHub
родитель cd487c812c
Коммит 38d0c2bcf3
5048 изменённых файлов: 57 добавлений и 1888164 удалений

Просмотреть файл

@@ -8,4 +8,4 @@ check_prereq()
echo "Checking enterprise prerequisites"
check_prereq 'xmlsec1'
check_prereq 'xmlsec1'

Просмотреть файл

@@ -35,7 +35,7 @@ echo "Checking prerequisites"
REQUIREDNODEVERSION=16.0.0
REQUIREDNPMVERSION=7.10.0
REQUIREDGOVERSION=1.14.0
REQUIREDGOVERSION=1.18.0
REQUIREDDOCKERVERSION=17.0
NODEVERSION=$(sed 's/v//' <<< $(node -v))

13
scripts/setup_go_work.sh Исполняемый файл
Просмотреть файл

@@ -0,0 +1,13 @@
#!/bin/bash
if [[ ! -f "go.work" ]] ;
then
echo "Creating a go.work file"
cat >go.work <<EOL
go 1.18
use ./
use ../enterprise
EOL
fi

Просмотреть файл

@@ -13,12 +13,13 @@ 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 './vendor/*' -not -path './data' | xargs rm -rf
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=$?