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

[DNM]test(ticdc): introduce new testkit to make writing unit test easier #10144

Closed
wants to merge 11 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions cdc/api/v2/api_helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ import (
func TestVerifyCreateChangefeedConfig(t *testing.T) {
ctx := context.Background()
pdClient := &mockPDClient{}
helper := entry.NewSchemaTestHelper(t)
helper.Tk().MustExec("use test;")
storage := helper.Storage()
tk := entry.NewTestKit(t, config.GetDefaultReplicaConfig())
tk.MustExec("use test;")
storage := tk.Storage()
ctrl := mock_controller.NewMockController(gomock.NewController(t))
cfg := &ChangefeedConfig{}
h := &APIV2HelpersImpl{}
Expand Down Expand Up @@ -112,9 +112,9 @@ func TestVerifyUpdateChangefeedConfig(t *testing.T) {
Config: config.GetDefaultReplicaConfig(),
}
oldUpInfo := &model.UpstreamInfo{}
helper := entry.NewSchemaTestHelper(t)
helper.Tk().MustExec("use test;")
storage := helper.Storage()
tk := entry.NewTestKit(t, config.GetDefaultReplicaConfig())
tk.MustExec("use test;")
storage := tk.Storage()
h := &APIV2HelpersImpl{}
newCfInfo, newUpInfo, err := h.verifyUpdateChangefeedConfig(ctx, cfg, oldInfo, oldUpInfo, storage, 0)
require.NotNil(t, err)
Expand Down
Loading
Loading