Skip to content

Commit

Permalink
✅ Update e2e tests
Browse files Browse the repository at this point in the history
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
  • Loading branch information
rinx committed Jan 20, 2021
1 parent 31d9436 commit 8186a7f
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 4 deletions.
36 changes: 33 additions & 3 deletions tests/e2e/crud_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,14 +282,24 @@ func TestE2EInsert(t *testing.T) {

count := 0
for {
_, err := sc.Recv()
res, err := sc.Recv()
if err == io.EOF {
t.Logf("%d items inserted.", count)
return
} else if err != nil {
t.Fatal(err)
}

loc := res.GetLocation()
if loc == nil {
err := res.GetStatus()
if err != nil {
t.Errorf("an error returned: %s", err.GetMessage())
}
} else {
t.Logf("returned: %s", loc)
}

count++

if count%1000 == 0 {
Expand Down Expand Up @@ -609,14 +619,24 @@ func TestE2EUpdate(t *testing.T) {

count := 0
for {
_, err := sc.Recv()
res, err := sc.Recv()
if err == io.EOF {
t.Logf("%d items updated.", count)
return
} else if err != nil {
t.Fatal(err)
}

loc := res.GetLocation()
if loc == nil {
err := res.GetStatus()
if err != nil {
t.Errorf("an error returned: %s", err.GetMessage())
}
} else {
t.Logf("returned: %s", loc)
}

count++

if count%1000 == 0 {
Expand Down Expand Up @@ -679,14 +699,24 @@ func TestE2ERemove(t *testing.T) {

count := 0
for {
_, err := sc.Recv()
res, err := sc.Recv()
if err == io.EOF {
t.Logf("%d items removed.", count)
return
} else if err != nil {
t.Fatal(err)
}

loc := res.GetLocation()
if loc == nil {
err := res.GetStatus()
if err != nil {
t.Errorf("an error returned: %s", err.GetMessage())
}
} else {
t.Logf("returned: %s", loc)
}

count++

if count%1000 == 0 {
Expand Down
12 changes: 11 additions & 1 deletion tests/e2e/sidecar_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,14 +270,24 @@ func TestE2EInsert(t *testing.T) {

count := 0
for {
_, err := sc.Recv()
res, err := sc.Recv()
if err == io.EOF {
t.Logf("%d items inserted.", count)
return
} else if err != nil {
t.Fatal(err)
}

loc := res.GetLocation()
if loc == nil {
err := res.GetStatus()
if err != nil {
t.Errorf("an error returned: %s", err.GetMessage())
}
} else {
t.Logf("returned: %s", loc)
}

count++

if count%1000 == 0 {
Expand Down

0 comments on commit 8186a7f

Please sign in to comment.