forked from pingcap/tidb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master' into improve-sysvar-co…
…verage * upstream/master: (98 commits) planner: provide a unified interface to set and get user variables and types (pingcap#37046) *: fix check-2 to bazel (pingcap#37055) distsql: revert 37019 (pingcap#37048) planner: introduce new functions for the general statement in session interface (pingcap#37024) session: make BenchmarkCompileExecutePreparedStmt update to date (pingcap#36960) server: Change proxyprotocol to lazy mode (pingcap#36301) test: fix `TestDDLSchedulingMultiTimes` and `TestConcurrentDDLSwitch` timeout (pingcap#37043) makefile: add bazel realtikvtest (pingcap#37042) distsql: make analyze request SI (pingcap#37019) *: gofmt code for adapting go 1.19 (pingcap#36832) planner: fix data race in the TestInlineProjection4HashJoinIssue15316 (pingcap#37014) planner: introduce Session.CacheGeneralStmt for general plan cache (pingcap#37028) server: revise scheme code (pingcap#37021) planner: fix unstable test TestPushDownSelectionForMPP (pingcap#37038) executor: more precise memory tracking (pingcap#35785) executor: add privilege check for prepare stmt (pingcap#36933) *: optimize temptable.SessionSnapshotInterceptor (pingcap#36999) statistics: batch insert topn and buckets to storage to speed up loading stats (pingcap#36948) planner: remove keyword `prepared` in plan cache backend (pingcap#37023) util: fix unstable test TestCheckCN (pingcap#37016) ...
- Loading branch information
Showing
403 changed files
with
15,920 additions
and
12,925 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
run: | ||
timeout: 10m | ||
linters: | ||
disable-all: true | ||
enable: | ||
- varcheck | ||
- structcheck | ||
- deadcode | ||
- rowserrcheck | ||
- prealloc | ||
|
||
issues: | ||
exclude-rules: | ||
- path: _test\.go | ||
linters: | ||
- errcheck | ||
- gosec | ||
- rowserrcheck | ||
- makezero | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,20 +29,21 @@ dev: checklist check explaintest gogenerate br_unit_test test_part_parser_dev ut | |
@>&2 echo "Great, all tests passed." | ||
|
||
# Install the check tools. | ||
check-setup:tools/bin/revive tools/bin/goword | ||
check-setup:tools/bin/revive | ||
|
||
check: check-parallel lint tidy testSuite check-static errdoc | ||
check: check-file-perm check-parallel lint tidy testSuite errdoc bazel_golangcilinter bazel_all_build | ||
|
||
fmt: | ||
@echo "gofmt (simplify)" | ||
@gofmt -s -l -w $(FILES) 2>&1 | $(FAIL_ON_STDOUT) | ||
|
||
goword:tools/bin/goword | ||
tools/bin/goword $(FILES) 2>&1 | $(FAIL_ON_STDOUT) | ||
|
||
check-static: tools/bin/golangci-lint | ||
GO111MODULE=on CGO_ENABLED=0 tools/bin/golangci-lint run -v $$($(PACKAGE_DIRECTORIES)) --config .golangci.yml | ||
|
||
check-file-perm: | ||
@echo "check file permission" | ||
./tools/check/check-file-perm.sh | ||
|
||
gogenerate: | ||
@echo "go generate ./..." | ||
./tools/check/check-gogenerate.sh | ||
|
@@ -211,17 +212,17 @@ tools/bin/revive: | |
GOBIN=$(shell pwd)/tools/bin $(GO) install github.com/mgechev/[email protected] | ||
|
||
tools/bin/failpoint-ctl: | ||
GOBIN=$(shell pwd)/tools/bin $(GO) install github.com/pingcap/failpoint/failpoint-ctl@master | ||
GOBIN=$(shell pwd)/tools/bin $(GO) install github.com/pingcap/failpoint/failpoint-ctl@2eaa328 | ||
|
||
tools/bin/errdoc-gen: | ||
GOBIN=$(shell pwd)/tools/bin $(GO) install github.com/pingcap/errors/errdoc-gen@master | ||
GOBIN=$(shell pwd)/tools/bin $(GO) install github.com/pingcap/errors/errdoc-gen@518f63d | ||
|
||
tools/bin/golangci-lint: | ||
# Build from source is not recommand. See https://golangci-lint.run/usage/install/ | ||
GOBIN=$(shell pwd)/tools/bin $(GO) install github.com/golangci/golangci-lint/cmd/[email protected] | ||
|
||
tools/bin/vfsgendev: | ||
GOBIN=$(shell pwd)/tools/bin $(GO) install github.com/shurcooL/vfsgen/cmd/vfsgendev@master | ||
GOBIN=$(shell pwd)/tools/bin $(GO) install github.com/shurcooL/vfsgen/cmd/vfsgendev@0d455de | ||
|
||
tools/bin/gotestsum: | ||
GOBIN=$(shell pwd)/tools/bin $(GO) install gotest.tools/[email protected] | ||
|
@@ -332,15 +333,6 @@ ifeq ("$(GOOS)", "freebsd") | |
GOBUILD = CGO_ENABLED=0 GO111MODULE=on go build -trimpath -ldflags '$(LDFLAGS)' | ||
endif | ||
|
||
br_coverage: | ||
tools/bin/gocovmerge "$(TEST_DIR)"/cov.* | grep -vE ".*.pb.go|.*__failpoint_binding__.go" > "$(TEST_DIR)/all_cov.out" | ||
ifeq ("$(JenkinsCI)", "1") | ||
tools/bin/goveralls -coverprofile=$(TEST_DIR)/all_cov.out -service=jenkins-ci -repotoken $(COVERALLS_TOKEN) | ||
else | ||
go tool cover -html "$(TEST_DIR)/all_cov.out" -o "$(TEST_DIR)/all_cov.html" | ||
grep -F '<option' "$(TEST_DIR)/all_cov.html" | ||
endif | ||
|
||
# TODO: adjust bins when br integraion tests reformat. | ||
br_bins: | ||
@which bin/tidb-server | ||
|
@@ -394,39 +386,75 @@ generate_grafana_scripts: | |
@cd metrics/grafana && mv tidb_summary.json tidb_summary.json.committed && ./generate_json.sh && diff -u tidb_summary.json.committed tidb_summary.json && rm tidb_summary.json.committed | ||
|
||
bazel_ci_prepare: | ||
bazel --output_user_root=/home/jenkins/.tidb/tmp run --config=ci //:gazelle | ||
bazel $(BAZEL_GLOBAL_CONFIG) run $(BAZEL_CMD_CONFIG) //:gazelle | ||
|
||
bazel_prepare: | ||
bazel run //:gazelle | ||
bazel run //:gazelle | ||
bazel run //:gazelle -- update-repos -from_file=go.mod -build_file_proto_mode=disable | ||
|
||
bazel_test: failpoint-enable bazel_ci_prepare | ||
bazel --output_user_root=/home/jenkins/.tidb/tmp test --config=ci \ | ||
bazel $(BAZEL_GLOBAL_CONFIG) test $(BAZEL_CMD_CONFIG) \ | ||
-- //... -//cmd/... -//tests/graceshutdown/... \ | ||
-//tests/globalkilltest/... -//tests/readonlytest/... -//br/pkg/task:task_test | ||
|
||
|
||
bazel_coverage_test: failpoint-enable bazel_ci_prepare | ||
bazel --output_user_root=/home/jenkins/.tidb/tmp coverage --config=ci --build_event_json_file=bazel_1.json --@io_bazel_rules_go//go/config:cover_format=go_cover \ | ||
bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) \ | ||
--build_event_json_file=bazel_1.json --@io_bazel_rules_go//go/config:cover_format=go_cover \ | ||
-- //... -//cmd/... -//tests/graceshutdown/... \ | ||
-//tests/globalkilltest/... -//tests/readonlytest/... -//br/pkg/task:task_test | ||
bazel --output_user_root=/home/jenkins/.tidb/tmp coverage --config=ci --build_event_json_file=bazel_2.json --@io_bazel_rules_go//go/config:cover_format=go_cover --define gotags=featuretag \ | ||
bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) \ | ||
--build_event_json_file=bazel_2.json --@io_bazel_rules_go//go/config:cover_format=go_cover --define gotags=featuretag \ | ||
-- //... -//cmd/... -//tests/graceshutdown/... \ | ||
-//tests/globalkilltest/... -//tests/readonlytest/... -//br/pkg/task:task_test | ||
|
||
bazel_all_build: bazel_ci_prepare | ||
mkdir -p bin | ||
bazel $(BAZEL_GLOBAL_CONFIG) build $(BAZEL_CMD_CONFIG) \ | ||
//... --//build:with_nogo_flag=true | ||
|
||
bazel_build: bazel_ci_prepare | ||
mkdir -p bin | ||
bazel --output_user_root=/home/jenkins/.tidb/tmp build --config=ci //... --//build:with_nogo_flag=true | ||
bazel $(BAZEL_GLOBAL_CONFIG) build $(BAZEL_CMD_CONFIG) \ | ||
//cmd/importer:importer //tidb-server:tidb-server //tidb-server:tidb-server-check --//build:with_nogo_flag=true | ||
cp bazel-out/k8-fastbuild/bin/tidb-server/tidb-server_/tidb-server ./bin | ||
cp bazel-out/k8-fastbuild/bin/cmd/importer/importer_/importer ./bin | ||
cp bazel-out/k8-fastbuild/bin/tidb-server/tidb-server-check_/tidb-server-check ./bin | ||
|
||
bazel_fail_build: failpoint-enable bazel_ci_prepare | ||
bazel --output_user_root=/home/jenkins/.tidb/tmp build --config=ci //... | ||
bazel $(BAZEL_GLOBAL_CONFIG) build $(BAZEL_CMD_CONFIG) \ | ||
//... | ||
|
||
bazel_clean: | ||
bazel --output_user_root=/home/jenkins/.tidb/tmp clean | ||
bazel $(BAZEL_GLOBAL_CONFIG) clean | ||
|
||
bazel_junit: | ||
bazel_collect | ||
@mkdir -p $(TEST_COVERAGE_DIR) | ||
mv ./junit.xml `$(TEST_COVERAGE_DIR)/junit.xml` | ||
|
||
bazel_golangcilinter: | ||
bazel $(BAZEL_GLOBAL_CONFIG) run $(BAZEL_CMD_CONFIG) \ | ||
--run_under="cd $(CURDIR) && " \ | ||
@com_github_golangci_golangci_lint//cmd/golangci-lint:golangci-lint \ | ||
-- run $$($(PACKAGE_DIRECTORIES)) --config ./.cilinter.yaml | ||
|
||
bazel_brietest: failpoint-enable bazel_ci_prepare | ||
bazel $(BAZEL_GLOBAL_CONFIG) test $(BAZEL_CMD_CONFIG) --test_arg=-with-real-tikv \ | ||
-- //tests/realtikvtest/brietest/... | ||
|
||
bazel_pessimistictest: failpoint-enable bazel_ci_prepare | ||
bazel $(BAZEL_GLOBAL_CONFIG) test $(BAZEL_CMD_CONFIG) --test_arg=-with-real-tikv \ | ||
-- //tests/realtikvtest/pessimistictest/... | ||
|
||
bazel_sessiontest: failpoint-enable bazel_ci_prepare | ||
bazel $(BAZEL_GLOBAL_CONFIG) test $(BAZEL_CMD_CONFIG) --test_arg=-with-real-tikv \ | ||
-- //tests/realtikvtest/sessiontest/... | ||
|
||
bazel_statisticstest: failpoint-enable bazel_ci_prepare | ||
bazel $(BAZEL_GLOBAL_CONFIG) test $(BAZEL_CMD_CONFIG) --test_arg=-with-real-tikv \ | ||
-- //tests/realtikvtest/statisticstest/... | ||
|
||
bazel_txntest: failpoint-enable bazel_ci_prepare | ||
bazel $(BAZEL_GLOBAL_CONFIG) test $(BAZEL_CMD_CONFIG) --test_arg=-with-real-tikv \ | ||
-- //tests/realtikvtest/txntest/... |
Oops, something went wrong.