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
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
11c0a861b2
Коммит
8194817d54
@@ -434,9 +434,6 @@ endif
|
|||||||
check-style: plugin-checker vet golangci-lint ## Runs style/lint checks
|
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-junit-report:
|
||||||
$(GO) install github.com/jstemmer/go-junit-report@v1.0.0
|
$(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; \
|
mv channels/imports/imports.go.orig channels/imports/imports.go; \
|
||||||
fi;
|
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)
|
ifeq ($(BUILD_ENTERPRISE_READY),true)
|
||||||
@echo Running all tests
|
@echo Running all tests
|
||||||
else
|
else
|
||||||
@@ -465,9 +462,9 @@ else
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
test-server-race: test-server-pre
|
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)" "$(TE_PACKAGES) $(EE_PACKAGES)" "$(TESTS)" "$(TESTFLAGS)" "$(GOBIN)" "90m"
|
||||||
./scripts/test.sh "$(GO)" "-race $(GOFLAGS)" "$(BOARDS_PACKAGES)" "$(TESTS)" "$(TESTFLAGS)" "$(GOBIN)" "90m" "atomic"
|
./scripts/test.sh "$(GO)" "-race $(GOFLAGS)" "$(BOARDS_PACKAGES)" "$(TESTS)" "$(TESTFLAGS)" "$(GOBIN)" "90m"
|
||||||
./scripts/test.sh "$(GO)" "-race $(GOFLAGS)" "$(PLAYBOOKS_PACKAGES)" "$(TESTS)" "$(TESTFLAGS)" "$(GOBIN)" "90m" "atomic"
|
./scripts/test.sh "$(GO)" "-race $(GOFLAGS)" "$(PLAYBOOKS_PACKAGES)" "$(TESTS)" "$(TESTFLAGS)" "$(GOBIN)" "90m"
|
||||||
ifneq ($(IS_CI),true)
|
ifneq ($(IS_CI),true)
|
||||||
ifneq ($(MM_NO_DOCKER),true)
|
ifneq ($(MM_NO_DOCKER),true)
|
||||||
ifneq ($(TEMP_DOCKER_SERVICES),)
|
ifneq ($(TEMP_DOCKER_SERVICES),)
|
||||||
@@ -478,7 +475,7 @@ ifneq ($(IS_CI),true)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
test-server: test-server-pre
|
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 ($(IS_CI),true)
|
||||||
ifneq ($(MM_NO_DOCKER),true)
|
ifneq ($(MM_NO_DOCKER),true)
|
||||||
ifneq ($(TEMP_DOCKER_SERVICES),)
|
ifneq ($(TEMP_DOCKER_SERVICES),)
|
||||||
@@ -488,9 +485,9 @@ ifneq ($(IS_CI),true)
|
|||||||
endif
|
endif
|
||||||
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
|
@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.
|
test-server-quick: check-prereqs-enterprise ## Runs only quick tests.
|
||||||
ifeq ($(BUILD_ENTERPRISE_READY),true)
|
ifeq ($(BUILD_ENTERPRISE_READY),true)
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ func databaseSettings(driver, dataSource string) *model.SqlSettings {
|
|||||||
*settings.ConnMaxIdleTimeMilliseconds = 300000
|
*settings.ConnMaxIdleTimeMilliseconds = 300000
|
||||||
*settings.MaxOpenConns = 100
|
*settings.MaxOpenConns = 100
|
||||||
*settings.QueryTimeout = 60
|
*settings.QueryTimeout = 60
|
||||||
*settings.MigrationsStatementTimeoutSeconds = 10
|
*settings.MigrationsStatementTimeoutSeconds = 60
|
||||||
|
|
||||||
return settings
|
return settings
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,7 @@
|
|||||||
set -e
|
set -e
|
||||||
[[ $1 =~ (github.com.*)/_test ]] && \
|
[[ $1 =~ (github.com.*)/_test ]] && \
|
||||||
echo Testing ${BASH_REMATCH[1]}
|
echo Testing ${BASH_REMATCH[1]}
|
||||||
coverprofile=`pwd`/cprofile.out
|
|
||||||
if [[ $1 == *"/enterprise/"* ]]; then
|
if [[ $1 == *"/enterprise/"* ]]; then
|
||||||
cd "$(dirname "$(dirname "${BASH_SOURCE[0]}")")"
|
cd "$(dirname "$(dirname "${BASH_SOURCE[0]}")")"
|
||||||
fi
|
fi
|
||||||
"$@" -test.coverprofile "$coverprofile"
|
"$@"
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ TESTS=$4
|
|||||||
TESTFLAGS=$5
|
TESTFLAGS=$5
|
||||||
GOBIN=$6
|
GOBIN=$6
|
||||||
TIMEOUT=$7
|
TIMEOUT=$7
|
||||||
COVERMODE=$8
|
|
||||||
|
|
||||||
PACKAGES_COMMA=$(echo $PACKAGES | tr ' ' ',')
|
PACKAGES_COMMA=$(echo $PACKAGES | tr ' ' ',')
|
||||||
export MM_SERVER_PATH=$PWD
|
export MM_SERVER_PATH=$PWD
|
||||||
@@ -23,15 +22,13 @@ then
|
|||||||
export GOMAXPROCS=4
|
export GOMAXPROCS=4
|
||||||
fi
|
fi
|
||||||
|
|
||||||
find . -name 'cprofile*.out' -exec sh -c 'rm "{}"' \;
|
|
||||||
find . -type d -name data -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 )
|
$GO test $GOFLAGS -run=$TESTS $TESTFLAGS -v -timeout=$TIMEOUT -exec $DIR/test-xprog.sh $PACKAGES 2>&1 > >( tee output )
|
||||||
EXIT_STATUS=$?
|
EXIT_STATUS=$?
|
||||||
|
|
||||||
cat output | $GOBIN/go-junit-report > report.xml
|
cat output | $GOBIN/go-junit-report > report.xml
|
||||||
rm output
|
rm output
|
||||||
find . -name 'cprofile*.out' -exec sh -c 'tail -n +2 "{}" >> cover.out ; rm "{}"' \;
|
|
||||||
rm -f config/*.crt
|
rm -f config/*.crt
|
||||||
rm -f config/*.key
|
rm -f config/*.key
|
||||||
|
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user