Skip to content

Commit

Permalink
add diego tests for instance reporting
Browse files Browse the repository at this point in the history
Signed-off-by: Zach Robinson <[email protected]>
  • Loading branch information
Ted Young authored and zrob committed Jun 9, 2014
1 parent 968bef1 commit ad9f0ac
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions diego/instance_reporting_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package diego

import (
"github.com/cloudfoundry-incubator/cf-test-helpers/cf"
"github.com/cloudfoundry-incubator/cf-test-helpers/generator"
"github.com/cloudfoundry/cf-acceptance-tests/helpers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/onsi/gomega/gbytes"
. "github.com/onsi/gomega/gexec"
)

var _ = Describe("Getting instance information", func() {
var appName string

BeforeEach(func() {
appName = generator.RandomName()

//Diego needs a custom buildpack until the ruby buildpack lands
Eventually(cf.Cf("push", appName, "-p", helpers.NewAssets().HelloWorld, "--no-start"), CF_PUSH_TIMEOUT).Should(Exit(0))
Eventually(cf.Cf("set-env", appName, "CF_DIEGO_RUN_BETA", "true"), DEFAULT_TIMEOUT).Should(Exit(0))

Eventually(cf.Cf("scale", appName, "-i", "3"), DEFAULT_TIMEOUT).Should(Exit(0))
Eventually(cf.Cf("start", appName), CF_PUSH_TIMEOUT).Should(Exit(0))
})

AfterEach(func() {
Eventually(cf.Cf("delete", appName, "-f"), DEFAULT_TIMEOUT).Should(Exit(0))
})

It("Retrieves instance information for cf app", func() {
app := cf.Cf("app", appName).Wait(DEFAULT_TIMEOUT)
Expect(app).To(Exit(0))
Expect(app).To(Say("instances: [0-3]/3"))
Expect(app).To(Say("#0"))
Expect(app).To(Say("#1"))
Expect(app).To(Say("#2"))
Expect(app).ToNot(Say("#3"))
})

It("Retrieves instance information for cf apps", func() {
app := cf.Cf("apps").Wait(DEFAULT_TIMEOUT)
Expect(app).To(Exit(0))
Expect(app).To(Say(appName))
Expect(app).To(Say("[0-3]/3"))
})
})

0 comments on commit ad9f0ac

Please sign in to comment.