(t *testing.T)
| 524 | } |
| 525 | |
| 526 | func TestReconcileContainers_NeverRecreate(t *testing.T) { |
| 527 | project := &types.Project{ |
| 528 | Name: "myproject", |
| 529 | Services: types.Services{ |
| 530 | "web": {Name: "web", Scale: intPtr(1)}, |
| 531 | }, |
| 532 | } |
| 533 | observed := &ObservedState{ |
| 534 | ProjectName: "myproject", |
| 535 | Containers: map[string][]ObservedContainer{ |
| 536 | "web": {{ |
| 537 | ID: "c1", Number: 1, State: container.StateRunning, ConfigHash: "oldhash", |
| 538 | Summary: container.Summary{ |
| 539 | ID: "c1", State: container.StateRunning, |
| 540 | Labels: map[string]string{api.ServiceLabel: "web", api.ContainerNumberLabel: "1", api.ConfigHashLabel: "oldhash"}, |
| 541 | }, |
| 542 | }}, |
| 543 | }, |
| 544 | Networks: map[string]ObservedNetwork{}, |
| 545 | Volumes: map[string]ObservedVolume{}, |
| 546 | } |
| 547 | |
| 548 | opts := defaultReconcileOptions() |
| 549 | opts.Recreate = api.RecreateNever |
| 550 | |
| 551 | plan, err := reconcile(t.Context(), project, observed, opts, noPrompt) |
| 552 | assert.NilError(t, err) |
| 553 | assert.Assert(t, plan.IsEmpty()) |
| 554 | } |
| 555 | |
| 556 | func TestReconcileContainers_ExitedIsNoop(t *testing.T) { |
| 557 | svc := types.ServiceConfig{Name: "web", Scale: intPtr(1)} |
nothing calls this directly
no test coverage detected