From 568a2c7addc7cac974e63b7e4e591b0e4aedd8d3 Mon Sep 17 00:00:00 2001 From: Benjamin Wang Date: Sat, 25 Nov 2023 15:48:08 +0000 Subject: [PATCH] remove unit test cases for v2store Signed-off-by: Benjamin Wang --- .../etcdserver/api/membership/cluster_test.go | 63 ------------------- 1 file changed, 63 deletions(-) diff --git a/server/etcdserver/api/membership/cluster_test.go b/server/etcdserver/api/membership/cluster_test.go index 62f188e3e74d..e2d01c72e1a2 100644 --- a/server/etcdserver/api/membership/cluster_test.go +++ b/server/etcdserver/api/membership/cluster_test.go @@ -17,14 +17,12 @@ package membership import ( "encoding/json" "fmt" - "path" "reflect" "testing" "github.com/stretchr/testify/assert" "go.uber.org/zap/zaptest" - "go.etcd.io/etcd/client/pkg/v3/testutil" "go.etcd.io/etcd/client/pkg/v3/types" "go.etcd.io/etcd/server/v3/etcdserver/api/v2store" "go.etcd.io/etcd/server/v3/mock/mockstore" @@ -519,52 +517,6 @@ func TestNodeToMemberBad(t *testing.T) { } } -func TestClusterAddMember(t *testing.T) { - st := mockstore.NewRecorder() - c := newTestCluster(t, nil) - c.SetStore(st) - c.AddMember(newTestMember(1, nil, "node1", nil), true) - - wactions := []testutil.Action{ - { - Name: "Create", - Params: []any{ - path.Join(StoreMembersPrefix, "1", "raftAttributes"), - false, - `{"peerURLs":null}`, - false, - v2store.TTLOptionSet{ExpireTime: v2store.Permanent}, - }, - }, - } - if g := st.Action(); !reflect.DeepEqual(g, wactions) { - t.Errorf("actions = %v, want %v", g, wactions) - } -} - -func TestClusterAddMemberAsLearner(t *testing.T) { - st := mockstore.NewRecorder() - c := newTestCluster(t, nil) - c.SetStore(st) - c.AddMember(newTestMemberAsLearner(1, []string{}, "node1", []string{"http://node1"}), true) - - wactions := []testutil.Action{ - { - Name: "Create", - Params: []any{ - path.Join(StoreMembersPrefix, "1", "raftAttributes"), - false, - `{"peerURLs":[],"isLearner":true}`, - false, - v2store.TTLOptionSet{ExpireTime: v2store.Permanent}, - }, - }, - } - if g := st.Action(); !reflect.DeepEqual(g, wactions) { - t.Errorf("actions = %v, want %v", g, wactions) - } -} - func TestClusterMembers(t *testing.T) { cls := newTestCluster(t, []*Member{ {ID: 1}, @@ -585,21 +537,6 @@ func TestClusterMembers(t *testing.T) { } } -func TestClusterRemoveMember(t *testing.T) { - st := mockstore.NewRecorder() - c := newTestCluster(t, nil) - c.SetStore(st) - c.RemoveMember(1, true) - - wactions := []testutil.Action{ - {Name: "Delete", Params: []any{MemberStoreKey(1), true, true}}, - {Name: "Create", Params: []any{RemovedMemberStoreKey(1), false, "", false, v2store.TTLOptionSet{ExpireTime: v2store.Permanent}}}, - } - if !reflect.DeepEqual(st.Action(), wactions) { - t.Errorf("actions = %v, want %v", st.Action(), wactions) - } -} - func TestClusterUpdateAttributes(t *testing.T) { name := "etcd" clientURLs := []string{"http://127.0.0.1:4001"}