(t *testing.T)
| 376 | } |
| 377 | |
| 378 | func TestCleanObjectStorage(t *testing.T) { |
| 379 | objDir := t.TempDir() |
| 380 | nod, engCfg, sto := prepare(t) |
| 381 | node1 := &specv1.Node{ |
| 382 | Name: "node1", |
| 383 | Version: "v1", |
| 384 | Report: map[string]interface{}{}, |
| 385 | Desire: map[string]interface{}{}, |
| 386 | } |
| 387 | appstats := []specv1.AppStats{{ |
| 388 | InstanceStats: map[string]specv1.InstanceStats{ |
| 389 | "job1": { |
| 390 | AppName: "svc1", |
| 391 | Status: specv1.Succeeded, |
| 392 | }, |
| 393 | "job2": { |
| 394 | AppName: "svc1", |
| 395 | Status: specv1.Failed, |
| 396 | }, |
| 397 | "deploy": { |
| 398 | AppName: "svc1", |
| 399 | Status: specv1.Running, |
| 400 | }, |
| 401 | }, |
| 402 | }} |
| 403 | node1.Report.SetAppStats(false, appstats) |
| 404 | appinfo := []specv1.AppInfo{{ |
| 405 | Name: "app2", |
| 406 | Version: "v2", |
| 407 | }} |
| 408 | node1.Report.SetAppInfos(false, appinfo) |
| 409 | _, err := nod.Report(node1.Report, false) |
| 410 | assert.NoError(t, err) |
| 411 | objCfg1 := specv1.Configuration{ |
| 412 | Name: "cfg1", |
| 413 | Version: "v1", |
| 414 | Data: map[string]string{ |
| 415 | specv1.PrefixConfigObject: "a.zip", |
| 416 | }, |
| 417 | } |
| 418 | objCfg2 := specv1.Configuration{ |
| 419 | Name: "cfg2", |
| 420 | Version: "v2", |
| 421 | Data: map[string]string{ |
| 422 | specv1.PrefixConfigObject: "b.zip", |
| 423 | }, |
| 424 | } |
| 425 | objCfg3 := specv1.Configuration{ |
| 426 | Name: "cfg3", |
| 427 | Version: "v3", |
| 428 | Data: map[string]string{ |
| 429 | specv1.PrefixConfigObject: "c.zip", |
| 430 | }, |
| 431 | } |
| 432 | err = sto.Upsert(makeKey(specv1.KindConfiguration, objCfg1.Name, objCfg1.Version), objCfg1) |
| 433 | assert.NoError(t, err) |
| 434 | err = sto.Upsert(makeKey(specv1.KindConfiguration, objCfg2.Name, objCfg2.Version), objCfg2) |
| 435 | assert.NoError(t, err) |
nothing calls this directly
no test coverage detected