(t *testing.T)
| 181 | } |
| 182 | |
| 183 | func 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 | |
| 215 | func TestProcessRunError(t *testing.T) { |
| 216 | testServer(t, func(c *stdsdk.Client, p *structs.MockProvider) { |
nothing calls this directly
no test coverage detected