Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into improve-sysvar-co…
Browse files Browse the repository at this point in the history
…verage

* upstream/master: (109 commits)
  *: rename TemporaryTableAttachedInfoSchema (pingcap#37408)
  *: enable noloopclosure (pingcap#37153)
  executor: add JSON opaque value condition to everywhere (pingcap#37390)
  *: refine mock session manager (pingcap#37400)
  lightning: check counter value to make code more robust (pingcap#37380)
  *: use go 1.19 (pingcap#36223)
  br: restore tiflash replica count after PiTR (pingcap#37181)
  testkit,executor: add MustQueryWitnContext API and fix unstable test TestCoprocessorPriority (pingcap#37382)
  executor: add conversion to opaque value for json_objectagg and json_arrayagg (pingcap#37337)
  expression: quote json path if necessarily (pingcap#37375)
  *: support ACCOUNT (UN)LOCK when creating/altering user (pingcap#37052)
  log-backup: support the ddl(exchange partition) when PiTR  (pingcap#37050)
  *: change `integration.BeforeTest` to `integration.BeforeTestExternal` to avoid skip tests (pingcap#37341)
  executor: fix unstable TestGlobalMemoryTrackerOnCleanUp (pingcap#37372)
  util/ranger: avoid building ranges twice in detachCNFCondAndBuildRangeForIndex (pingcap#37177)
  statistics: track used stats status during query (pingcap#37101)
  *: fix data race in `TestTiFlashGroupIndexWhenStartup` (pingcap#37371)
  lightning: fix dpanic log when init session vars (pingcap#37301)
  executor: let plan replayer record table tiflash replica (pingcap#37336)
  types: fix a bug in casting str2str when `union` (pingcap#37242)
  ...
  • Loading branch information
morgo committed Aug 27, 2022
2 parents d71b97f + a8f524b commit 028958e
Show file tree
Hide file tree
Showing 400 changed files with 18,381 additions and 12,636 deletions.
23 changes: 16 additions & 7 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@
startup --host_jvm_args=-Xmx8g
startup --unlimit_coredumps

run:ci --color=yes

build --announce_rc
build --java_language_version=17
build --java_runtime_version=17
build --tool_java_language_version=17
build --tool_java_runtime_version=17

run --color=yes
build:release --workspace_status_command=./build/print-workspace-status.sh --stamp
build:release --config=ci
build --incompatible_strict_action_env --incompatible_enable_cc_toolchain_resolution
build:ci --color=yes
build:ci --experimental_remote_cache_compression
test:ci --verbose_failures
test:ci --test_env=GO_TEST_WRAP_TESTV=1 --test_verbose_timeout_warnings
test:ci --test_env=TZ=Asia/Shanghai --test_output=errors --experimental_ui_max_stdouterr_bytes=104857600
build:release --workspace_status_command=./build/print-workspace-status.sh --stamp
build:release --config=ci
build:race --config=ci
build:race --@io_bazel_rules_go//go/config:race --test_env=GORACE=halt_on_error=1 --test_sharding_strategy=disabled

test --test_env=TZ=Asia/Shanghai
test --test_output=errors --test_summary=testcase
test:ci --color=yes
test:ci --verbose_failures --test_verbose_timeout_warnings
test:ci --test_env=GO_TEST_WRAP_TESTV=1
test:ci --experimental_ui_max_stdouterr_bytes=104857600
test:race --test_timeout=1200,6000,18000,72000

try-import /data/bazel
56 changes: 56 additions & 0 deletions .github/workflows/integration-test-dumpling-common.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: DumplingCommon
on:
workflow_call:
inputs:
debug:
type: boolean
description: 'set tmate on failure'
required: true
mysql_version:
type: string
description: 'specify mysql version'
required: true

jobs:
integration-test:
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: true
services:
mysql:
image: mysql:${{ inputs.mysql_version }}
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- name: 'checkout repository'
uses: actions/checkout@v3
- name: 'set up golang'
uses: actions/setup-go@v3
with:
go-version: 1.18
- name: 'try to use build cache'
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
~/Library/Caches/go-build
~\AppData\Local\go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: 'download binary dependencies'
run: sh dumpling/install.sh
- name: 'build tidb'
run: make server
- name: 'build lightning'
run: make build_lightning
- name: 'integration test'
run: make dumpling_integration_test VERBOSE="true"
- name: 'set up tmate session if necessary'
if: ${{ failure() && inputs.debug }}
uses: mxschmitt/action-tmate@v3
130 changes: 22 additions & 108 deletions .github/workflows/integration-test-dumpling.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
name: Dumpling
on:
workflow_dispatch:
inputs:
debug:
type: boolean
description: 'Run the build with tmate debugging enabled'
required: false
default: false
push:
branches:
- master
Expand Down Expand Up @@ -32,113 +39,20 @@ concurrency:
cancel-in-progress: true

jobs:
integration-test-mysql-5735:
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: true
services:
mysql:
image: mysql:5.7.35
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- uses: actions/checkout@v2
- name: Shutdown Ubuntu MySQL (SUDO)
run: sudo service mysql stop # Shutdown the Default MySQL, "sudo" is necessary, please not remove it
- name: Set up Go 1.18
uses: actions/setup-go@v2
with:
go-version: 1.18
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Get dependencies
run: go mod download
- name: Download dependencies
run: sh dumpling/install.sh
- name: Integration test
run: make dumpling_integration_test VERBOSE="true"
- name: Set up tmate session
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3
mysql-5735:
uses: ./.github/workflows/integration-test-dumpling-common.yml
with:
debug: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug }}
mysql_version: 5.7.35

integration-test-mysql-8026:
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: true
services:
mysql:
image: mysql:8.0.26
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- uses: actions/checkout@v2
- name: Shutdown Ubuntu MySQL (SUDO)
run: sudo service mysql stop # Shutdown the Default MySQL, "sudo" is necessary, please not remove it
- name: Set up Go 1.18
uses: actions/setup-go@v2
with:
go-version: 1.18
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Get dependencies
run: go mod download
- name: Download dependencies
run: sh dumpling/install.sh
- name: Integration test
run: make dumpling_integration_test VERBOSE="true"
- name: Set up tmate session
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3
mysql-8022:
uses: ./.github/workflows/integration-test-dumpling-common.yml
with:
debug: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug }}
mysql_version: 8.0.22

integration-test-mysql-8022:
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: true
services:
mysql:
image: mysql:8.0.22
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- uses: actions/checkout@v2
- name: Shutdown Ubuntu MySQL (SUDO)
run: sudo service mysql stop # Shutdown the Default MySQL, "sudo" is necessary, please not remove it
- name: Set up Go 1.18
uses: actions/setup-go@v2
with:
go-version: 1.18
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Get dependencies
run: go mod download
- name: Download dependencies
run: sh dumpling/install.sh
- name: Integration test
run: make dumpling_integration_test VERBOSE="true"
- name: Set up tmate session
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3
mysql-8026:
uses: ./.github/workflows/integration-test-dumpling-common.yml
with:
debug: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug }}
mysql_version: 8.0.26
14 changes: 0 additions & 14 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,3 @@ xcode_version(
name = "xcode_version",
version = "10.0",
)

filegroup(
name = "package-srcs",
srcs = glob(
["**"],
exclude = [
"bazel-*/**",
".git/**",
".idea/**",
],
),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
16 changes: 12 additions & 4 deletions DEPS.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -884,6 +884,14 @@ def go_deps():
sum = "h1:DddqAaWDpywytcG8w/qoQ5sAN8X12d3Z3koB0C3Rxsc=",
version = "v0.0.0-20160511215533-1f3b11f56072",
)
go_repository(
name = "com_github_fatanugraha_noloopclosure",
build_file_proto_mode = "disable",
importpath = "github.com/fatanugraha/noloopclosure",
sum = "h1:AhepjAikNpk50qTZoipHZqeZtnyKT/C2Tk5dGn7nC+A=",
version = "v0.1.1",
)

go_repository(
name = "com_github_fatih_color",
build_file_proto_mode = "disable_global",
Expand Down Expand Up @@ -1572,8 +1580,8 @@ def go_deps():
name = "com_github_gostaticanalysis_testutil",
build_file_proto_mode = "disable",
importpath = "github.com/gostaticanalysis/testutil",
sum = "h1:d2/eIbH9XjD1fFwD5SHv8x168fjbQ9PB8hvs8DSEC08=",
version = "v0.3.1-0.20210208050101-bfb5c8eec0e4",
sum = "h1:nhdCmubdmDF6VEatUNjgUZBJKWRqugoISdUv3PPQgHY=",
version = "v0.4.0",
)

go_repository(
Expand Down Expand Up @@ -3366,8 +3374,8 @@ def go_deps():
name = "com_github_tikv_client_go_v2",
build_file_proto_mode = "disable_global",
importpath = "github.com/tikv/client-go/v2",
sum = "h1:tugwRUqH0gYZ0noHr17AVSKxNVd+Jl2BmNqgANeDIok=",
version = "v2.0.1-0.20220809034808-2ed2113d1090",
sum = "h1:/nr7P8uzJQ7u3wPEBHCokrsVmuDvi/1x/zI/ydk5n8U=",
version = "v2.0.1-0.20220818084834-0d0ae0dcfb1f",
)
go_repository(
name = "com_github_tikv_pd_client",
Expand Down
14 changes: 10 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ endif
bench-daily:
go test github.com/pingcap/tidb/session -run TestBenchDaily -bench Ignore --outfile bench_daily.json
go test github.com/pingcap/tidb/executor -run TestBenchDaily -bench Ignore --outfile bench_daily.json
go test github.com/pingcap/tidb/executor/splittest -run TestBenchDaily -bench Ignore --outfile bench_daily.json
go test github.com/pingcap/tidb/tablecodec -run TestBenchDaily -bench Ignore --outfile bench_daily.json
go test github.com/pingcap/tidb/expression -run TestBenchDaily -bench Ignore --outfile bench_daily.json
go test github.com/pingcap/tidb/util/rowcodec -run TestBenchDaily -bench Ignore --outfile bench_daily.json
Expand Down Expand Up @@ -371,7 +372,8 @@ dumpling_unit_test_in_verify_ci: failpoint-enable tools/bin/gotestsum
$(RACE_FLAG) -coverprofile="$(TEST_COVERAGE_DIR)/dumpling_cov.unit_test.out" || ( make failpoint-disable && exit 1 )
@make failpoint-disable

dumpling_integration_test: dumpling_bins failpoint-enable build_dumpling
dumpling_integration_test: dumpling_bins failpoint-enable
@make build_dumpling
@make failpoint-disable
./dumpling/tests/run.sh $(CASE)

Expand All @@ -390,7 +392,7 @@ bazel_ci_prepare:

bazel_prepare:
bazel run //:gazelle
bazel run //:gazelle -- update-repos -from_file=go.mod -build_file_proto_mode=disable
bazel run //:gazelle -- update-repos -from_file=go.mod -to_macro DEPS.bzl%go_deps -build_file_proto_mode=disable

bazel_test: failpoint-enable bazel_ci_prepare
bazel $(BAZEL_GLOBAL_CONFIG) test $(BAZEL_CMD_CONFIG) \
Expand All @@ -402,11 +404,11 @@ bazel_coverage_test: failpoint-enable bazel_ci_prepare
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
-//tests/globalkilltest/... -//tests/readonlytest/... -//br/pkg/task:task_test -//tests/realtikvtest/...
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
-//tests/globalkilltest/... -//tests/readonlytest/... -//br/pkg/task:task_test -//tests/realtikvtest/...

bazel_all_build: bazel_ci_prepare
mkdir -p bin
Expand Down Expand Up @@ -458,3 +460,7 @@ bazel_statisticstest: failpoint-enable bazel_ci_prepare
bazel_txntest: failpoint-enable bazel_ci_prepare
bazel $(BAZEL_GLOBAL_CONFIG) test $(BAZEL_CMD_CONFIG) --test_arg=-with-real-tikv \
-- //tests/realtikvtest/txntest/...

bazel_addindextest: failpoint-enable bazel_ci_prepare
bazel $(BAZEL_GLOBAL_CONFIG) test $(BAZEL_CMD_CONFIG) --test_arg=-with-real-tikv \
-- //tests/realtikvtest/addindextest/...
2 changes: 1 addition & 1 deletion WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ go_rules_dependencies()

go_register_toolchains(
nogo = "@//build:tidb_nogo",
version = "1.18.5",
version = "1.19",
)

gazelle_dependencies()
Expand Down
4 changes: 3 additions & 1 deletion bindinfo/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ go_test(
],
embed = [":bindinfo"],
flaky = True,
shard_count = 50,
deps = [
"//config",
"//domain",
Expand All @@ -66,10 +67,11 @@ go_test(
"//parser/auth",
"//parser/model",
"//parser/terror",
"//session/txninfo",
"//server",
"//sessionctx/variable",
"//testkit",
"//testkit/testsetup",
"//testkit/testutil",
"//util",
"//util/hack",
"//util/parser",
Expand Down
Loading

0 comments on commit 028958e

Please sign in to comment.