Skip to content

Commit

Permalink
Re-enabled loggregator tests
Browse files Browse the repository at this point in the history
- Added a SIGINT to stop tailing the logs

Signed-off-by: David Varvel <[email protected]>
  • Loading branch information
Karl Isenberg authored and lvarvel committed May 6, 2014
1 parent 915244d commit 68b4165
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions apps/loggregator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/pivotal-cf-experimental/cf-test-helpers/generator"
)

var _ = PDescribe("loggregator", func() {
var _ = Describe("loggregator", func() {
var appName string

BeforeEach(func() {
Expand All @@ -27,18 +27,26 @@ var _ = PDescribe("loggregator", func() {
})

Context("gcf logs", func() {
It("blocks and exercises basic loggregator behavior", func() {
logs := cf.Cf("logs", appName)
var logs *Session

BeforeEach(func() {
logs = cf.Cf("logs", appName)
})

AfterEach(func() {
// logs might be nil if the BeforeEach panics
if logs != nil {
logs.Interrupt().Wait(DEFAULT_TIMEOUT)
}
})

It("exercises basic loggregator behavior", func() {
Eventually(logs, DEFAULT_TIMEOUT).Should(Say("Connected, tailing logs for app"))

Expect(helpers.CurlAppRoot(appName)).To(ContainSubstring("Hi, I'm Dora!"))

expectedLogMessage := fmt.Sprintf("OUT %s.%s", appName, helpers.LoadConfig().AppsDomain)
Eventually(logs, DEFAULT_TIMEOUT).Should(Say(expectedLogMessage))

// stop tailing the logs
Expect(logs.Interrupt().Wait(DEFAULT_TIMEOUT)).To(Exit(0))
})
})

Expand Down

0 comments on commit 68b4165

Please sign in to comment.