Skip to content

Commit

Permalink
Fix e2e integration tests (#8149)
Browse files Browse the repository at this point in the history
  • Loading branch information
cheeseandcereal authored Jan 20, 2025
1 parent 9125ee2 commit a9f115b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
2 changes: 0 additions & 2 deletions integration/tests/accessentries/accessentries_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,6 @@ var _ = Describe("(Integration) [AccessEntries Test]", func() {
).Run()
Expect(session.ExitCode()).To(Equal(0))
Expect(json.Unmarshal(session.Out.Contents(), &output)).To(Succeed())
// taking into account the cluster creator admin permission access entry
Expect(output).To(HaveLen(4))
Expect(output).To(ContainElements(cfg.AccessConfig.AccessEntries))
})

Expand Down
20 changes: 13 additions & 7 deletions integration/tests/auto_mode/auto_mode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
. "github.com/onsi/gomega/gstruct"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"github.com/aws/aws-sdk-go-v2/aws"
Expand Down Expand Up @@ -97,16 +98,21 @@ var _ = Describe("Auto Mode", Ordered, func() {
deployment, err := test.GetDeployment(test.Namespace, "podinfo")
Expect(err).NotTo(HaveOccurred())
nodeList := test.ListNodes(metav1.ListOptions{})
Expect(nodeList.Items).To(HaveLen(1))
node := nodeList.Items[0]
const labelName = "eks.amazonaws.com/compute-type"
computeType, ok := node.Labels[labelName]
Expect(ok).To(BeTrue(), "expected to find label %s on node %s", labelName, node.Name)
Expect(computeType).To(Equal("auto"))
Expect(nodeList.Items).NotTo(BeEmpty())
for _, node := range nodeList.Items {
const labelName = "eks.amazonaws.com/compute-type"
computeType, ok := node.Labels[labelName]
Expect(ok).To(BeTrue(), "expected to find label %s on node %s", labelName, node.Name)
Expect(computeType).To(Equal("auto"))
}
podList := test.ListPodsFromDeployment(deployment)
Expect(podList.Items).To(HaveLen(2))
for _, pod := range podList.Items {
Expect(node.Name).To(Equal(pod.Spec.NodeName))
Expect(nodeList.Items).To(ContainElement(MatchFields(IgnoreExtras, Fields{
"ObjectMeta": MatchFields(IgnoreExtras, Fields{
"Name": Equal(pod.Spec.NodeName),
}),
})))
}
})

Expand Down

0 comments on commit a9f115b

Please sign in to comment.