(t *testing.T)
| 353 | } |
| 354 | |
| 355 | func TestReconcileContainers_AlreadyRunning(t *testing.T) { |
| 356 | svc := types.ServiceConfig{Name: "web", Scale: intPtr(1)} |
| 357 | hash := mustServiceHash(t, svc) |
| 358 | |
| 359 | project := &types.Project{ |
| 360 | Name: "myproject", |
| 361 | Services: types.Services{"web": svc}, |
| 362 | } |
| 363 | observed := &ObservedState{ |
| 364 | ProjectName: "myproject", |
| 365 | Containers: map[string][]ObservedContainer{ |
| 366 | "web": {{ |
| 367 | ID: "c1", Number: 1, State: container.StateRunning, ConfigHash: hash, |
| 368 | Summary: container.Summary{ |
| 369 | ID: "c1", State: container.StateRunning, |
| 370 | Labels: map[string]string{api.ServiceLabel: "web", api.ContainerNumberLabel: "1", api.ConfigHashLabel: hash}, |
| 371 | }, |
| 372 | }}, |
| 373 | }, |
| 374 | Networks: map[string]ObservedNetwork{}, |
| 375 | Volumes: map[string]ObservedVolume{}, |
| 376 | } |
| 377 | |
| 378 | plan, err := reconcile(t.Context(), project, observed, defaultReconcileOptions(), noPrompt) |
| 379 | assert.NilError(t, err) |
| 380 | assert.Assert(t, plan.IsEmpty()) |
| 381 | } |
| 382 | |
| 383 | func TestReconcileContainers_ConfigChanged(t *testing.T) { |
| 384 | project := &types.Project{ |
nothing calls this directly
no test coverage detected