Skip to content

Commit

Permalink
Add get cluster integration test
Browse files Browse the repository at this point in the history
Adding an integration test for listing the active
clusters, ensuring the previously created cluster
is listed and exit code != 0.

Issue #208
  • Loading branch information
Bryan Peterson committed Oct 14, 2018
1 parent a26d484 commit 89767b6
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/integration/create_get_delete/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
const (
createTimeout = 20
deleteTimeout = 10
getTimeout = 1
region = "us-west-2"
)

Expand Down Expand Up @@ -187,6 +188,31 @@ var _ = Describe("Create (Integration)", func() {
})
})

Describe("when listing clusters", func() {
var (
err error
session *gexec.Session
)

It("should not return an error", func() {
args := []string{"get", "cluster", "--region", region}

command := exec.Command(eksctlPath, args...)
session, err = gexec.Start(command, GinkgoWriter, GinkgoWriter)

if err != nil {
Fail(fmt.Sprintf("error starting process: %v", err), 1)
}

session.Wait(getTimeout * time.Minute)
Expect(session.ExitCode()).Should(Equal(0))
})

It("should return the previously created cluster", func() {
Expect(string(session.Buffer().Contents())).To(ContainSubstring(clusterName))
})
})

Describe("when deleting a cluster", func() {
var (
err error
Expand Down

0 comments on commit 89767b6

Please sign in to comment.