Skip to content

Commit

Permalink
Simplify code.
Browse files Browse the repository at this point in the history
  • Loading branch information
friedrichwilken committed Dec 8, 2023
1 parent 0ab82ba commit 54ae363
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions e2e/setup/setup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,10 @@ func Test_PodsResources(t *testing.T) {

// The number of Pods must be equal NATS.spec.cluster.size. We check this in the retry, because it may take
// some time for all Pods to be there.
if len(pods.Items) != NATSCR().Spec.Cluster.Size {
if len(pods.Items) != NATSCR().Spec.Size {
return fmt.Errorf(
"error while fetching Pods; wanted %v Pods but got %v",
NATSCR().Spec.Cluster.Size,
NATSCR().Spec.Size,
pods.Items,
)
}
Expand All @@ -223,10 +223,10 @@ func Test_PodsResources(t *testing.T) {
}
}
}
if foundContainers != NATSCR().Spec.Cluster.Size {
if foundContainers != NATSCR().Spec.Size {
return fmt.Errorf(
"error while fethching 'natsCR' Containers: expected %v but found %v",
NATSCR().Spec.Cluster.Size,
NATSCR().Spec.Size,
foundContainers,
)
}
Expand Down Expand Up @@ -258,9 +258,9 @@ func Test_PodsReady(t *testing.T) {

// The number of Pods must be equal NATS.spec.cluster.size. We check this in the retry, because it may take
// some time for all Pods to be there.
if len(pods.Items) != natsCR.Spec.Cluster.Size {
if len(pods.Items) != natsCR.Spec.Size {
return fmt.Errorf(
"Error while fetching pods; wanted %v Pods but got %v", natsCR.Spec.Cluster.Size, pods.Items,
"Error while fetching pods; wanted %v Pods but got %v", natsCR.Spec.Size, pods.Items,
)
}

Expand Down Expand Up @@ -308,7 +308,7 @@ func Test_PVCs(t *testing.T) {

// Check if the amount of PVCs is equal to the spec.cluster.size in the NATS CR. We do this in the retry,
// because it may take some time for all PVCs to be there.
want, actual := NATSCR().Spec.Cluster.Size, len(pvcs.Items)
want, actual := NATSCR().Spec.Size, len(pvcs.Items)
if want != actual {
return fmt.Errorf("error while fetching PVSs; wanted %v PVCs but got %v", want, actual)
}
Expand Down

0 comments on commit 54ae363

Please sign in to comment.