MCPcopy Create free account
hub / github.com/convox/rack / TestDeployWait

Function TestDeployWait

pkg/cli/deploy_test.go:72–105  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

70}
71
72func TestDeployWait(t *testing.T) {
73 testClientWait(t, 100*time.Millisecond, func(e *cli.Engine, i *mocksdk.Interface) {
74 i.On("SystemGet").Return(fxSystem(), nil)
75 i.On("ObjectStore", "app1", mock.AnythingOfType("string"), mock.Anything, structs.ObjectStoreOptions{}).Return(&fxObject, nil).Run(func(args mock.Arguments) {
76 require.Regexp(t, `tmp/[0-9a-f]{30}\.tgz`, args.Get(1).(string))
77 })
78 i.On("BuildCreate", "app1", "object://test", mock.Anything).Return(fxBuild(), nil)
79 i.On("BuildLogs", "app1", "build1", structs.LogsOptions{}).Return(testLogs(fxLogs()), nil)
80 i.On("BuildGet", "app1", "build1").Return(fxBuildRunning(), nil).Once()
81 i.On("BuildGet", "app1", "build4").Return(fxBuild(), nil)
82 i.On("AppGet", "app1").Return(fxApp(), nil).Once()
83 i.On("ReleasePromote", "app1", "release1", structs.ReleasePromoteOptions{}).Return(nil)
84 i.On("AppGet", "app1").Return(fxAppUpdating(), nil).Twice()
85 i.On("AppGet", "app1").Return(fxApp(), nil)
86 opts := structs.LogsOptions{Prefix: options.Bool(true), Since: options.Duration(5 * time.Second)}
87 i.On("AppLogs", "app1", opts).Return(testLogs(fxLogsSystem()), nil)
88
89 res, err := testExecute(e, "deploy ./testdata/httpd -a app1 -d foo --wait", nil)
90 require.NoError(t, err)
91 require.Equal(t, 0, res.Code)
92 res.RequireStderr(t, []string{""})
93 res.RequireStdout(t, []string{
94 "Packaging source... OK",
95 "Uploading source... OK",
96 "Starting build... OK",
97 "log1",
98 "log2",
99 "Promoting release1... ",
100 fxLogsSystem()[0],
101 fxLogsSystem()[1],
102 "OK",
103 })
104 })
105}

Callers

nothing calls this directly

Calls 15

BoolFunction · 0.92
DurationFunction · 0.92
testClientWaitFunction · 0.85
fxSystemFunction · 0.85
fxBuildFunction · 0.85
testLogsFunction · 0.85
fxLogsFunction · 0.85
fxBuildRunningFunction · 0.85
fxAppFunction · 0.85
fxAppUpdatingFunction · 0.85
fxLogsSystemFunction · 0.85
testExecuteFunction · 0.85

Tested by

no test coverage detected