forked from deis/workflow-e2e
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgit_push_test.go
More file actions
109 lines (76 loc) · 2.33 KB
/
git_push_test.go
File metadata and controls
109 lines (76 loc) · 2.33 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
package tests
import (
"os"
"github.com/deis/workflow-e2e/tests/cmd"
"github.com/deis/workflow-e2e/tests/cmd/apps"
"github.com/deis/workflow-e2e/tests/cmd/auth"
"github.com/deis/workflow-e2e/tests/cmd/git"
"github.com/deis/workflow-e2e/tests/cmd/keys"
"github.com/deis/workflow-e2e/tests/model"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("git push deis master", func() {
Context("with an existing user", func() {
var user model.User
var keyPath string
BeforeEach(func() {
user = auth.Register()
})
AfterEach(func() {
auth.Cancel(user)
})
Context("who has added their public key", func() {
BeforeEach(func() {
_, keyPath = keys.Add(user)
})
Context("and who has a local git repo containing buildpack source code", func() {
BeforeEach(func() {
output, err := cmd.Execute(`git clone https://github.com/deis/example-go.git`)
Expect(err).NotTo(HaveOccurred(), output)
})
Context("and has run `deis apps:create` from within that repo", func() {
var app model.App
BeforeEach(func() {
os.Chdir("example-go")
app = apps.Create(user)
})
AfterEach(func() {
apps.Destroy(user, app)
})
Specify("that user can deploy that app using a git push", func() {
git.Push(user, keyPath, app, "Powered by Deis")
})
Specify("that user can interrupt the deploy of the app and recover", func() {
git.PushWithInterrupt(user, keyPath)
git.PushUntilResult(user, keyPath,
model.CmdResult{
Out: nil,
Err: []byte("Everything up-to-date"),
ExitCode: 0,
})
})
})
})
Context("and who has a local git repo containing dockerfile source code", func() {
BeforeEach(func() {
output, err := cmd.Execute(`git clone https://github.com/deis/example-dockerfile-http.git`)
Expect(err).NotTo(HaveOccurred(), output)
})
Context("and has run `deis apps:create` from within that repo", func() {
var app model.App
BeforeEach(func() {
os.Chdir("example-dockerfile-http")
app = apps.Create(user)
})
AfterEach(func() {
apps.Destroy(user, app)
})
Specify("that user can deploy that app using a git push", func() {
git.Push(user, keyPath, app, "Powered by Deis")
})
})
})
})
})
})