(t *testing.T)
| 1239 | } |
| 1240 | |
| 1241 | func TestSystemProcesses(t *testing.T) { |
| 1242 | ps := structs.Processes{ |
| 1243 | { |
| 1244 | Id: "id1", |
| 1245 | App: "app1", |
| 1246 | Command: "command", |
| 1247 | Cpu: 5, |
| 1248 | Host: "host", |
| 1249 | Image: "image", |
| 1250 | Instance: "instance", |
| 1251 | Memory: 1024, |
| 1252 | Name: "name", |
| 1253 | Ports: []string{"5000"}, |
| 1254 | Release: "release", |
| 1255 | Status: "status", |
| 1256 | TaskDefinition: "task_definition", |
| 1257 | }, |
| 1258 | } |
| 1259 | |
| 1260 | s := stdapi.New("api", "api") |
| 1261 | s.Route("GET", fmt.Sprintf("/system/processes"), func(c *stdapi.Context) error { |
| 1262 | require.Equal(t, "true", c.Query("all")) |
| 1263 | return c.RenderJSON(ps) |
| 1264 | }) |
| 1265 | |
| 1266 | testServer(t, s, func(c *sdk.Client) { |
| 1267 | got, err := c.SystemProcesses(structs.SystemProcessesOptions{ |
| 1268 | All: options.Bool(true), |
| 1269 | }) |
| 1270 | require.NoError(t, err) |
| 1271 | require.Equal(t, ps, got) |
| 1272 | }) |
| 1273 | } |
| 1274 | |
| 1275 | func TestSystemReleases(t *testing.T) { |
| 1276 | rs := structs.Releases{{ |
nothing calls this directly
no test coverage detected