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
This commit is contained in:
Jesse Hallam 2023-06-09 07:29:08 -03:00 committed by GitHub
parent 11c0a861b2
commit 8194817d54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 17 deletions

View File

@ -434,9 +434,6 @@ endif
check-style: plugin-checker vet golangci-lint ## Runs style/lint checks
do-cover-file: ## Creates the test coverage report file.
@echo "mode: count" > cover.out
go-junit-report:
$(GO) install github.com/jstemmer/go-junit-report@v1.0.0
@ -457,7 +454,7 @@ modules-tidy:
mv channels/imports/imports.go.orig channels/imports/imports.go; \
fi;
test-server-pre: check-prereqs-enterprise start-docker go-junit-report do-cover-file ## Runs tests.
test-server-pre: check-prereqs-enterprise start-docker go-junit-report ## Runs tests.
ifeq ($(BUILD_ENTERPRISE_READY),true)
@echo Running all tests
else
@ -465,9 +462,9 @@ else
endif
test-server-race: test-server-pre
./scripts/test.sh "$(GO)" "-race $(GOFLAGS)" "$(TE_PACKAGES) $(EE_PACKAGES)" "$(TESTS)" "$(TESTFLAGS)" "$(GOBIN)" "90m" "atomic"
./scripts/test.sh "$(GO)" "-race $(GOFLAGS)" "$(BOARDS_PACKAGES)" "$(TESTS)" "$(TESTFLAGS)" "$(GOBIN)" "90m" "atomic"
./scripts/test.sh "$(GO)" "-race $(GOFLAGS)" "$(PLAYBOOKS_PACKAGES)" "$(TESTS)" "$(TESTFLAGS)" "$(GOBIN)" "90m" "atomic"
./scripts/test.sh "$(GO)" "-race $(GOFLAGS)" "$(TE_PACKAGES) $(EE_PACKAGES)" "$(TESTS)" "$(TESTFLAGS)" "$(GOBIN)" "90m"
./scripts/test.sh "$(GO)" "-race $(GOFLAGS)" "$(BOARDS_PACKAGES)" "$(TESTS)" "$(TESTFLAGS)" "$(GOBIN)" "90m"
./scripts/test.sh "$(GO)" "-race $(GOFLAGS)" "$(PLAYBOOKS_PACKAGES)" "$(TESTS)" "$(TESTFLAGS)" "$(GOBIN)" "90m"
ifneq ($(IS_CI),true)
ifneq ($(MM_NO_DOCKER),true)
ifneq ($(TEMP_DOCKER_SERVICES),)
@ -478,7 +475,7 @@ ifneq ($(IS_CI),true)
endif
test-server: test-server-pre
./scripts/test.sh "$(GO)" "$(GOFLAGS)" "$(SUITE_PACKAGES) $(EE_PACKAGES)" "$(TESTS)" "$(TESTFLAGS)" "$(GOBIN)" "90m" "count"
./scripts/test.sh "$(GO)" "$(GOFLAGS)" "$(SUITE_PACKAGES) $(EE_PACKAGES)" "$(TESTS)" "$(TESTFLAGS)" "$(GOBIN)" "90m"
ifneq ($(IS_CI),true)
ifneq ($(MM_NO_DOCKER),true)
ifneq ($(TEMP_DOCKER_SERVICES),)
@ -488,9 +485,9 @@ ifneq ($(IS_CI),true)
endif
endif
test-server-ee: check-prereqs-enterprise start-docker go-junit-report do-cover-file ## Runs EE tests.
test-server-ee: check-prereqs-enterprise start-docker go-junit-report ## Runs EE tests.
@echo Running only EE tests
./scripts/test.sh "$(GO)" "$(GOFLAGS)" "$(EE_PACKAGES)" "$(TESTS)" "$(TESTFLAGS)" "$(GOBIN)" "20m" "count"
./scripts/test.sh "$(GO)" "$(GOFLAGS)" "$(EE_PACKAGES)" "$(TESTS)" "$(TESTFLAGS)" "$(GOBIN)" "20m"
test-server-quick: check-prereqs-enterprise ## Runs only quick tests.
ifeq ($(BUILD_ENTERPRISE_READY),true)

View File

@ -182,7 +182,7 @@ func databaseSettings(driver, dataSource string) *model.SqlSettings {
*settings.ConnMaxIdleTimeMilliseconds = 300000
*settings.MaxOpenConns = 100
*settings.QueryTimeout = 60
*settings.MigrationsStatementTimeoutSeconds = 10
*settings.MigrationsStatementTimeoutSeconds = 60
return settings
}

View File

@ -2,8 +2,7 @@
set -e
[[ $1 =~ (github.com.*)/_test ]] && \
echo Testing ${BASH_REMATCH[1]}
coverprofile=`pwd`/cprofile.out
if [[ $1 == *"/enterprise/"* ]]; then
cd "$(dirname "$(dirname "${BASH_SOURCE[0]}")")"
fi
"$@" -test.coverprofile "$coverprofile"
"$@"

View File

@ -10,7 +10,6 @@ TESTS=$4
TESTFLAGS=$5
GOBIN=$6
TIMEOUT=$7
COVERMODE=$8
PACKAGES_COMMA=$(echo $PACKAGES | tr ' ' ',')
export MM_SERVER_PATH=$PWD
@ -23,15 +22,13 @@ 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 )
$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
find . -name 'cprofile*.out' -exec sh -c 'tail -n +2 "{}" >> cover.out ; rm "{}"' \;
rm -f config/*.crt
rm -f config/*.key