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

Function TestProcessRun

pkg/api/process_test.go:183–213  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

181}
182
183func TestProcessRun(t *testing.T) {
184 testServer(t, func(c *stdsdk.Client, p *structs.MockProvider) {
185 a1 := fxApp
186 p.On("AppGet", "app1").Return(&a1, nil)
187 p1 := fxProcess
188 p2 := structs.Process{}
189 opts := structs.ProcessRunOptions{
190 Command: options.String("command"),
191 Environment: map[string]string{"k1": "v1", "k2": "v2"},
192 Height: options.Int(1),
193 Memory: options.Int(2),
194 Release: options.String("release"),
195 Width: options.Int(3),
196 }
197 ro := stdsdk.RequestOptions{
198 Body: strings.NewReader("in"),
199 Headers: stdsdk.Headers{
200 "Command": "command",
201 "Environment": "k1=v1&k2=v2",
202 "Height": "1",
203 "Memory": "2",
204 "Release": "release",
205 "Width": "3",
206 },
207 }
208 p.On("ProcessRun", "app1", "service1", opts).Return(&p1, nil)
209 err := c.Post("/apps/app1/services/service1/processes", ro, &p2)
210 require.NoError(t, err)
211 require.Equal(t, p1, p2)
212 })
213}
214
215func TestProcessRunError(t *testing.T) {
216 testServer(t, func(c *stdsdk.Client, p *structs.MockProvider) {

Callers

nothing calls this directly

Calls 4

StringFunction · 0.92
IntFunction · 0.92
PostMethod · 0.80
testServerFunction · 0.70

Tested by

no test coverage detected