From 9a64217cfae8899ffc51ade818ec46756a883601 Mon Sep 17 00:00:00 2001 From: lvtu <37565148+tongtongyin@users.noreply.github.com> Date: Mon, 13 Dec 2021 16:38:36 +0800 Subject: [PATCH] executor: migrate test-infra to testify for executor/shuffle_test.go (#30514) --- executor/shuffle_test.go | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/executor/shuffle_test.go b/executor/shuffle_test.go index 0059c67429bb3..bc1b7a82d2bb8 100644 --- a/executor/shuffle_test.go +++ b/executor/shuffle_test.go @@ -15,20 +15,19 @@ package executor import ( - . "github.com/pingcap/check" + "testing" + "github.com/pingcap/tidb/expression" "github.com/pingcap/tidb/parser/mysql" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tidb/util/mock" + "github.com/stretchr/testify/require" ) -var _ = SerialSuites(&testPartitionSuite{}) - -type testPartitionSuite struct { -} +func TestPartitionRangeSplitter(t *testing.T) { + t.Parallel() -func (s *testPartitionSuite) TestPartitionRangeSplitter(c *C) { ctx := mock.NewContext() concurrency := 2 @@ -60,9 +59,9 @@ func (s *testPartitionSuite) TestPartitionRangeSplitter(c *C) { splitter := buildPartitionRangeSplitter(ctx, concurrency, byItems) obtained, err := splitter.split(ctx, input, obtained) - c.Assert(err, IsNil) - c.Assert(len(obtained), Equals, len(expected)) + require.NoError(t, err) + require.Len(t, obtained, len(expected)) for i := 0; i < len(obtained); i++ { - c.Assert(obtained[i], Equals, expected[i]) + require.Equal(t, expected[i], obtained[i]) } }