Skip to content

Commit

Permalink
ddl: migrate test-infra to testify for ddl/options_test.go (#30269)
Browse files Browse the repository at this point in the history
  • Loading branch information
tongtongyin authored Dec 1, 2021
1 parent fa686a9 commit 92c7c07
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions ddl/options_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,21 @@
package ddl_test

import (
"testing"
"time"

. "github.com/pingcap/check"
"github.com/pingcap/tidb/ddl"
"github.com/pingcap/tidb/infoschema"
"github.com/pingcap/tidb/util/mock"
"github.com/stretchr/testify/require"
"go.etcd.io/etcd/clientv3"
)

type ddlOptionsSuite struct{}
func TestOptions(t *testing.T) {
t.Parallel()

var _ = Suite(&ddlOptionsSuite{})

func (s *ddlOptionsSuite) TestOptions(c *C) {
client, err := clientv3.NewFromURL("test")
c.Assert(err, IsNil)
require.NoError(t, err)
callback := &ddl.BaseCallback{}
lease := time.Second * 3
store := &mock.Store{}
Expand All @@ -49,9 +48,9 @@ func (s *ddlOptionsSuite) TestOptions(c *C) {
o(opt)
}

c.Assert(opt.EtcdCli, Equals, client)
c.Assert(opt.Hook, Equals, callback)
c.Assert(opt.Lease, Equals, lease)
c.Assert(opt.Store, Equals, store)
c.Assert(opt.InfoCache, Equals, infoHandle)
require.Equal(t, client, opt.EtcdCli)
require.Equal(t, callback, opt.Hook)
require.Equal(t, lease, opt.Lease)
require.Equal(t, store, opt.Store)
require.Equal(t, infoHandle, opt.InfoCache)
}

0 comments on commit 92c7c07

Please sign in to comment.