MCPcopy
hub / github.com/docker/compose / TestReconcileContainers_AlreadyRunning

Function TestReconcileContainers_AlreadyRunning

pkg/compose/reconcile_test.go:355–381  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

353}
354
355func 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
383func TestReconcileContainers_ConfigChanged(t *testing.T) {
384 project := &types.Project{

Callers

nothing calls this directly

Calls 5

intPtrFunction · 0.85
mustServiceHashFunction · 0.85
reconcileFunction · 0.85
defaultReconcileOptionsFunction · 0.85
IsEmptyMethod · 0.45

Tested by

no test coverage detected