-
Notifications
You must be signed in to change notification settings - Fork 990
Expand file tree
/
Copy pathlogs_test.go
More file actions
86 lines (69 loc) · 2.15 KB
/
logs_test.go
File metadata and controls
86 lines (69 loc) · 2.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
package plugin
import (
"code.cloudfoundry.org/cli/v8/integration/helpers"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
. "github.com/onsi/gomega/gbytes"
. "github.com/onsi/gomega/gexec"
)
var _ = Describe("logs", func() {
BeforeEach(func() {
installTestPlugin()
})
AfterEach(func() {
uninstallTestPlugin()
})
var (
organization string
space string
appName string
)
BeforeEach(func() {
organization, space = createTargetedOrgAndSpace()
appName = helpers.PrefixedRandomName("APP")
})
AfterEach(func() {
helpers.QuickDeleteSpace(space)
helpers.QuickDeleteOrg(organization)
})
When("pushing an application from a plugin", func() {
It("outputs logs from the staging process", func() {
helpers.WithHelloWorldApp(func(appDir string) {
session := helpers.CF("CliCommand", "push",
appName, "-p", appDir, "-b", "staticfile_buildpack")
Eventually(session).Should(Exit(0))
Expect(session).To(Say("Downloading app package..."))
Expect(session).To(Say("Uploading complete"))
})
})
})
When("tailing logs for an app from a plugin", func() {
BeforeEach(func() {
helpers.WithHelloWorldApp(func(appDir string) {
session := helpers.CF("push", appName, "-p", appDir, "-b", "staticfile_buildpack")
Eventually(session).Should(Exit(0))
})
})
It("outputs the application logs", func() {
logSession := helpers.CF("CliCommand", "logs", appName)
restageSession := helpers.CF("restage", appName)
Eventually(restageSession).Should(Exit(0))
Eventually(logSession).Should(Say("Staticfile Buildpack version"))
logSession.Interrupt()
Eventually(logSession).Should(Exit())
})
})
When("viewing recent logs for an app from a plugin", func() {
BeforeEach(func() {
helpers.WithHelloWorldApp(func(appDir string) {
session := helpers.CF("push", appName, "-p", appDir, "-b", "staticfile_buildpack")
Eventually(session).Should(Exit(0))
})
})
It("outputs the recent application logs", func() {
session := helpers.CF("CliCommand", "logs", appName, "--recent")
Eventually(session).Should(Exit(0))
Expect(session).To(Say("Staticfile Buildpack version"))
})
})
})