From 7440d95cef3b198b402d018d64e7ca128545b2f1 Mon Sep 17 00:00:00 2001 From: lvtu Date: Wed, 8 Dec 2021 10:10:46 +0800 Subject: [PATCH 1/2] migrate test-infra to testify for shuffle_test.go --- executor/shuffle_test.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/executor/shuffle_test.go b/executor/shuffle_test.go index 0059c67429bb3..9c047b108a279 100644 --- a/executor/shuffle_test.go +++ b/executor/shuffle_test.go @@ -15,20 +15,20 @@ 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 (s *testPartitionSuite) TestPartitionRangeSplitter(c *C) { +func TestPartitionRangeSplitter(t *testing.T) { ctx := mock.NewContext() concurrency := 2 @@ -60,9 +60,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]) } } From 6fbf272c87b8b776c29df7a71a66402344f66744 Mon Sep 17 00:00:00 2001 From: lvtu Date: Wed, 8 Dec 2021 10:28:44 +0800 Subject: [PATCH 2/2] migrate test-infra to testify for shuffle_test.go --- executor/shuffle_test.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/executor/shuffle_test.go b/executor/shuffle_test.go index 9c047b108a279..bc1b7a82d2bb8 100644 --- a/executor/shuffle_test.go +++ b/executor/shuffle_test.go @@ -25,10 +25,9 @@ import ( "github.com/stretchr/testify/require" ) -type testPartitionSuite struct { -} - func TestPartitionRangeSplitter(t *testing.T) { + t.Parallel() + ctx := mock.NewContext() concurrency := 2