Skip to content

Commit

Permalink
ddl: split add index real tikv tests (#48097)
Browse files Browse the repository at this point in the history
close #48094
  • Loading branch information
ywqzzy authored Oct 30, 2023
1 parent f8ca23c commit e88b3a6
Show file tree
Hide file tree
Showing 13 changed files with 324 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,30 @@ bazel_addindextest: failpoint-enable bazel_ci_simple_prepare
-- //tests/realtikvtest/addindextest/...
./build/jenkins_collect_coverage.sh

bazel_addindextest1: failpoint-enable bazel_ci_simple_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/addindextest1/...
./build/jenkins_collect_coverage.sh

bazel_addindextest2: failpoint-enable bazel_ci_simple_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/addindextest2/...
./build/jenkins_collect_coverage.sh

bazel_addindextest3: failpoint-enable bazel_ci_simple_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/addindextest3/...
./build/jenkins_collect_coverage.sh

bazel_addindextest4: failpoint-enable bazel_ci_simple_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/addindextest4/...
./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: failpoint-enable bazel_ci_simple_prepare
bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) --test_output=all --test_arg=-with-real-tikv --define gotags=deadlock,intest \
Expand Down
16 changes: 16 additions & 0 deletions tests/realtikvtest/addindextest1/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
load("@io_bazel_rules_go//go:def.bzl", "go_test")

go_test(
name = "addindextest1_test",
timeout = "short",
srcs = [
"dummy_test.go",
"main_test.go",
],
flaky = True,
deps = [
"//pkg/config",
"//tests/realtikvtest",
"@com_github_stretchr_testify//require",
],
)
25 changes: 25 additions & 0 deletions tests/realtikvtest/addindextest1/dummy_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Copyright 2023 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package addindextest

import (
"testing"

"github.com/stretchr/testify/require"
)

func TestDummy(t *testing.T) {
require.NoError(t, nil)
}
34 changes: 34 additions & 0 deletions tests/realtikvtest/addindextest1/main_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// Copyright 2023 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package addindextest

import (
"flag"
"testing"

"github.com/pingcap/tidb/pkg/config"
"github.com/pingcap/tidb/tests/realtikvtest"
)

// FullMode is a flag identify it should be run in full mode.
// In full mode, the test will run all the cases.
var FullMode = flag.Bool("full-mode", false, "whether tests run in full mode")

func TestMain(m *testing.M) {
config.UpdateGlobal(func(conf *config.Config) {
conf.Store = "tikv"
})
realtikvtest.RunTestMain(m)
}
16 changes: 16 additions & 0 deletions tests/realtikvtest/addindextest2/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
load("@io_bazel_rules_go//go:def.bzl", "go_test")

go_test(
name = "addindextest2_test",
timeout = "short",
srcs = [
"dummy_test.go",
"main_test.go",
],
flaky = True,
deps = [
"//pkg/config",
"//tests/realtikvtest",
"@com_github_stretchr_testify//require",
],
)
25 changes: 25 additions & 0 deletions tests/realtikvtest/addindextest2/dummy_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Copyright 2023 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package addindextest

import (
"testing"

"github.com/stretchr/testify/require"
)

func TestDummy(t *testing.T) {
require.NoError(t, nil)
}
34 changes: 34 additions & 0 deletions tests/realtikvtest/addindextest2/main_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// Copyright 2023 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package addindextest

import (
"flag"
"testing"

"github.com/pingcap/tidb/pkg/config"
"github.com/pingcap/tidb/tests/realtikvtest"
)

// FullMode is a flag identify it should be run in full mode.
// In full mode, the test will run all the cases.
var FullMode = flag.Bool("full-mode", false, "whether tests run in full mode")

func TestMain(m *testing.M) {
config.UpdateGlobal(func(conf *config.Config) {
conf.Store = "tikv"
})
realtikvtest.RunTestMain(m)
}
16 changes: 16 additions & 0 deletions tests/realtikvtest/addindextest3/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
load("@io_bazel_rules_go//go:def.bzl", "go_test")

go_test(
name = "addindextest3_test",
timeout = "short",
srcs = [
"dummy_test.go",
"main_test.go",
],
flaky = True,
deps = [
"//pkg/config",
"//tests/realtikvtest",
"@com_github_stretchr_testify//require",
],
)
25 changes: 25 additions & 0 deletions tests/realtikvtest/addindextest3/dummy_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Copyright 2023 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package addindextest

import (
"testing"

"github.com/stretchr/testify/require"
)

func TestDummy(t *testing.T) {
require.NoError(t, nil)
}
34 changes: 34 additions & 0 deletions tests/realtikvtest/addindextest3/main_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// Copyright 2023 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package addindextest

import (
"flag"
"testing"

"github.com/pingcap/tidb/pkg/config"
"github.com/pingcap/tidb/tests/realtikvtest"
)

// FullMode is a flag identify it should be run in full mode.
// In full mode, the test will run all the cases.
var FullMode = flag.Bool("full-mode", false, "whether tests run in full mode")

func TestMain(m *testing.M) {
config.UpdateGlobal(func(conf *config.Config) {
conf.Store = "tikv"
})
realtikvtest.RunTestMain(m)
}
16 changes: 16 additions & 0 deletions tests/realtikvtest/addindextest4/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
load("@io_bazel_rules_go//go:def.bzl", "go_test")

go_test(
name = "addindextest4_test",
timeout = "short",
srcs = [
"dummy_test.go",
"main_test.go",
],
flaky = True,
deps = [
"//pkg/config",
"//tests/realtikvtest",
"@com_github_stretchr_testify//require",
],
)
25 changes: 25 additions & 0 deletions tests/realtikvtest/addindextest4/dummy_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Copyright 2023 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package addindextest

import (
"testing"

"github.com/stretchr/testify/require"
)

func TestDummy(t *testing.T) {
require.NoError(t, nil)
}
34 changes: 34 additions & 0 deletions tests/realtikvtest/addindextest4/main_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// Copyright 2023 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package addindextest

import (
"flag"
"testing"

"github.com/pingcap/tidb/pkg/config"
"github.com/pingcap/tidb/tests/realtikvtest"
)

// FullMode is a flag identify it should be run in full mode.
// In full mode, the test will run all the cases.
var FullMode = flag.Bool("full-mode", false, "whether tests run in full mode")

func TestMain(m *testing.M) {
config.UpdateGlobal(func(conf *config.Config) {
conf.Store = "tikv"
})
realtikvtest.RunTestMain(m)
}

0 comments on commit e88b3a6

Please sign in to comment.