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

executor: migrate test-infra to testify for executor/shuffle_test.go #30514

Merged
merged 6 commits into from
Dec 13, 2021
17 changes: 8 additions & 9 deletions executor/shuffle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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])
}
}