Skip to content

Commit

Permalink
[tests] fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
notbdu committed Mar 2, 2021
1 parent cb81012 commit 75ae345
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions pkg/apis/m3dboperator/v1alpha1/cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ func TestStatus(t *testing.T) {
f: func(s *M3DBStatus) bool { return s.HasInitializedPlacement() },
},
{
cond: ClusterConditionPodBootstrapping,
f: func(s *M3DBStatus) bool { return s.HasPodBootstrapping() },
cond: ClusterConditionPodsBootstrapping,
f: func(s *M3DBStatus) bool { return s.HasPodsBootstrapping() },
},
} {
t.Run(string(test.cond), func(t *testing.T) {
Expand Down
9 changes: 6 additions & 3 deletions pkg/m3admin/placement/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func TestAdd(t *testing.T) {
return
}

const expected = `{"instances":[{"id":"a"}]}`
const expected = `{"instances":[{"id":"a"},{"id":"b"}]}`
assert.Equal(t, expected, string(bytes))

w.WriteHeader(200)
Expand All @@ -100,7 +100,10 @@ func TestAdd(t *testing.T) {
defer s.Close()
client := newPlacementClient(t, s.URL)

err := client.Add(placementpb.Instance{Id: "a"})
err := client.Add([]*placementpb.Instance{
{Id: "a"},
{Id: "b"},
})
require.Nil(t, err)
}

Expand All @@ -113,7 +116,7 @@ func TestAddErr(t *testing.T) {
defer s.Close()
client := newPlacementClient(t, s.URL)

err := client.Add(placementpb.Instance{})
err := client.Add([]*placementpb.Instance{})
require.NotNil(t, err)
}

Expand Down

0 comments on commit 75ae345

Please sign in to comment.