Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*: remove embed failpoint into bazel #45289

Merged
merged 1 commit into from
Jul 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
60 changes: 26 additions & 34 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -457,17 +457,16 @@ check-bazel-prepare:
@echo "make bazel_prepare"
./tools/check/check-bazel-prepare.sh

bazel_test: bazel_prepare
bazel_test: failpoint-enable bazel_prepare
bazel $(BAZEL_GLOBAL_CONFIG) test $(BAZEL_CMD_CONFIG) --build_tests_only --test_keep_going=false \
$(BAZEL_TEST_CONFIG) \
--define gotags=deadlock,intest \
-- //... -//cmd/... -//tests/graceshutdown/... \
-//tests/globalkilltest/... -//tests/readonlytest/... -//br/pkg/task:task_test -//tests/realtikvtest/...


bazel_coverage_test: check-bazel-prepare bazel_ci_prepare
bazel_coverage_test: check-bazel-prepare failpoint-enable bazel_ci_prepare
bazel $(BAZEL_GLOBAL_CONFIG) --nohome_rc coverage $(BAZEL_CMD_CONFIG) --jobs=35 --build_tests_only --test_keep_going=false \
$(BAZEL_TEST_CONFIG) \
--@io_bazel_rules_go//go/config:cover_format=go_cover \
--@io_bazel_rules_go//go/config:cover_format=go_cover --define gotags=deadlock,intest \
-- //... -//cmd/... -//tests/graceshutdown/... \
-//tests/globalkilltest/... -//tests/readonlytest/... -//br/pkg/task:task_test -//tests/realtikvtest/...

Expand All @@ -484,7 +483,7 @@ bazel_build: bazel_ci_prepare
//tidb-server:tidb-server --stamp --workspace_status_command=./build/print-enterprise-workspace-status.sh --define gotags=enterprise
./bazel-out/k8-fastbuild/bin/tidb-server/tidb-server_/tidb-server -V

bazel_fail_build: bazel_ci_prepare
bazel_fail_build: failpoint-enable bazel_ci_prepare
bazel $(BAZEL_GLOBAL_CONFIG) build $(BAZEL_CMD_CONFIG) \
//...

Expand All @@ -502,53 +501,46 @@ bazel_golangcilinter:
@com_github_golangci_golangci_lint//cmd/golangci-lint:golangci-lint \
-- run $$($(PACKAGE_DIRECTORIES)) --config ./.golangci.yaml

bazel_brietest: bazel_ci_prepare
bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) --test_arg=-with-real-tikv \
$(BAZEL_TEST_CONFIG) \
--@io_bazel_rules_go//go/config:cover_format=go_cover \
bazel_brietest: failpoint-enable bazel_ci_prepare
bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) --test_arg=-with-real-tikv --define gotags=deadlock,intest \
--@io_bazel_rules_go//go/config:cover_format=go_cover \
-- //tests/realtikvtest/brietest/...
./build/jenkins_collect_coverage.sh

bazel_pessimistictest: bazel_ci_prepare
bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) --test_arg=-with-real-tikv \
$(BAZEL_TEST_CONFIG) \
--@io_bazel_rules_go//go/config:cover_format=go_cover \
bazel_pessimistictest: failpoint-enable bazel_ci_prepare
bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) --test_arg=-with-real-tikv --define gotags=deadlock,intest \
--@io_bazel_rules_go//go/config:cover_format=go_cover \
-- //tests/realtikvtest/pessimistictest/...
./build/jenkins_collect_coverage.sh

bazel_sessiontest: bazel_ci_prepare
bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) --test_arg=-with-real-tikv \
$(BAZEL_TEST_CONFIG) \
--@io_bazel_rules_go//go/config:cover_format=go_cover \
bazel_sessiontest: failpoint-enable bazel_ci_prepare
bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) --test_arg=-with-real-tikv --define gotags=deadlock,intest \
--@io_bazel_rules_go//go/config:cover_format=go_cover \
-- //tests/realtikvtest/sessiontest/...
./build/jenkins_collect_coverage.sh

bazel_statisticstest: bazel_ci_prepare
bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) --test_arg=-with-real-tikv \
$(BAZEL_TEST_CONFIG) \
--@io_bazel_rules_go//go/config:cover_format=go_cover \
bazel_statisticstest: failpoint-enable bazel_ci_prepare
bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) --test_arg=-with-real-tikv --define gotags=deadlock,intest \
--@io_bazel_rules_go//go/config:cover_format=go_cover \
-- //tests/realtikvtest/statisticstest/...
./build/jenkins_collect_coverage.sh

bazel_txntest: bazel_ci_prepare
bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) --test_arg=-with-real-tikv \
$(BAZEL_TEST_CONFIG) \
--@io_bazel_rules_go//go/config:cover_format=go_cover \
bazel_txntest: failpoint-enable bazel_ci_prepare
bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) --test_arg=-with-real-tikv --define gotags=deadlock,intest \
--@io_bazel_rules_go//go/config:cover_format=go_cover \
-- //tests/realtikvtest/txntest/...
./build/jenkins_collect_coverage.sh

bazel_addindextest: bazel_ci_prepare
bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) --test_arg=-with-real-tikv \
$(BAZEL_TEST_CONFIG) \
--@io_bazel_rules_go//go/config:cover_format=go_cover \
bazel_addindextest: failpoint-enable bazel_ci_prepare
bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) --test_arg=-with-real-tikv --define gotags=deadlock,intest \
--@io_bazel_rules_go//go/config:cover_format=go_cover \
-- //tests/realtikvtest/addindextest/...
./build/jenkins_collect_coverage.sh

# on timeout, bazel won't print log sometimes, so we use --test_output=all to print log always
bazel_importintotest: bazel_ci_prepare
bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) --test_output=all --test_arg=-with-real-tikv \
$(BAZEL_TEST_CONFIG) \
--@io_bazel_rules_go//go/config:cover_format=go_cover \
bazel_importintotest: failpoint-enable bazel_ci_prepare
bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) --test_output=all --test_arg=-with-real-tikv --define gotags=deadlock,intest \
--@io_bazel_rules_go//go/config:cover_format=go_cover \
-- //tests/realtikvtest/importintotest/...
./build/jenkins_collect_coverage.sh

Expand Down
1 change: 0 additions & 1 deletion Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,3 @@ ifneq ("$(CI)", "")
BAZEL_GLOBAL_CONFIG := --output_user_root=/home/jenkins/.tidb/tmp
BAZEL_CMD_CONFIG := --config=ci --repository_cache=/home/jenkins/.tidb/tmp
endif
BAZEL_TEST_CONFIG := --define gotags=deadlock,intest --@io_bazel_rules_go//go/config:failpoint=true
11 changes: 5 additions & 6 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")

http_archive(
name = "bazel_skylib",
Expand All @@ -17,12 +16,12 @@ versions.check(minimum_bazel_version = "6.0.0")

http_archive(
name = "io_bazel_rules_go",
sha256 = "d6f7f8844dc21647aa306c423ddb27174fcaa223592b950f7f75928921391036",
strip_prefix = "rules_go-304ca54e9d70081a889c1a15270ae43d38ae053b",
type = "zip",
sha256 = "51dc53293afe317d2696d4d6433a4c33feedb7748a9e352072e2ec3c0dafd2c6",
urls = [
"http://bazel-cache.pingcap.net:8080/xhebox/rules_go/zip/304ca54e9d70081a889c1a15270ae43d38ae053b",
"https://codeload.github.com/xhebox/rules_go/zip/304ca54e9d70081a889c1a15270ae43d38ae053b",
"http://bazel-cache.pingcap.net:8080/bazelbuild/rules_go/releases/download/v0.40.1/rules_go-v0.40.1.zip",
"http://ats.apps.svc/bazelbuild/rules_go/releases/download/v0.40.1/rules_go-v0.40.1.zip",
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.40.1/rules_go-v0.40.1.zip",
"https://github.com/bazelbuild/rules_go/releases/download/v0.40.1/rules_go-v0.40.1.zip",
],
)

Expand Down
10 changes: 5 additions & 5 deletions WORKSPACE.patchgo
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ versions.check(minimum_bazel_version = "6.0.0")

http_archive(
name = "io_bazel_rules_go",
sha256 = "d6f7f8844dc21647aa306c423ddb27174fcaa223592b950f7f75928921391036",
strip_prefix = "rules_go-304ca54e9d70081a889c1a15270ae43d38ae053b",
type = "zip",
sha256 = "bfc5ce70b9d1634ae54f4e7b495657a18a04e0d596785f672d35d5f505ab491a",
urls = [
"http://bazel-cache.pingcap.net:8080/xhebox/rules_go/zip/304ca54e9d70081a889c1a15270ae43d38ae053b",
"https://codeload.github.com/xhebox/rules_go/zip/304ca54e9d70081a889c1a15270ae43d38ae053b",
"http://bazel-cache.pingcap.net:8080/bazelbuild/rules_go/releases/download/v0.40.0/rules_go-v0.40.0.zip",
"http://ats.apps.svc/bazelbuild/rules_go/releases/download/v0.40.0/rules_go-v0.40.0.zip",
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.40.0/rules_go-v0.40.0.zip",
"https://github.com/bazelbuild/rules_go/releases/download/v0.40.0/rules_go-v0.40.0.zip",
],
)

Expand Down