forked from deis/deis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreleases_test.go
57 lines (47 loc) · 1.48 KB
/
releases_test.go
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
// +build integration
package tests
import (
"testing"
"github.com/deis/deis/tests/utils"
)
var (
releasesListCmd = "releases:list --app={{.AppName}}"
releasesInfoCmd = "releases:info {{.Version}} --app={{.AppName}}"
releasesRollbackCmd = "releases:rollback {{.Version}} --app={{.AppName}}"
)
func TestReleases(t *testing.T) {
params := releasesSetup(t)
releasesListTest(t, params, false)
releasesInfoTest(t, params)
releasesRollbackTest(t, params)
appsOpenTest(t, params)
params.Version = "4"
releasesListTest(t, params, false)
utils.AppsDestroyTest(t, params)
}
func releasesSetup(t *testing.T) *utils.DeisTestConfig {
cfg := utils.GetGlobalConfig()
cfg.AppName = "releasessample"
utils.Execute(t, authLoginCmd, cfg, false, "")
utils.Execute(t, gitCloneCmd, cfg, false, "")
if err := utils.Chdir(cfg.ExampleApp); err != nil {
t.Fatal(err)
}
utils.Execute(t, appsCreateCmd, cfg, false, "")
utils.Execute(t, gitPushCmd, cfg, false, "")
if err := utils.Chdir(".."); err != nil {
t.Fatal(err)
}
utils.Execute(t, configSetCmd, cfg, false, "")
return cfg
}
func releasesInfoTest(t *testing.T, params *utils.DeisTestConfig) {
utils.Execute(t, releasesInfoCmd, params, false, "")
}
func releasesListTest(
t *testing.T, params *utils.DeisTestConfig, notflag bool) {
utils.CheckList(t, releasesListCmd, params, params.Version, notflag)
}
func releasesRollbackTest(t *testing.T, params *utils.DeisTestConfig) {
utils.Execute(t, releasesRollbackCmd, params, false, "")
}