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

Function TestReconcileContainers_NeverRecreate

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

Source from the content-addressed store, hash-verified

524}
525
526func 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
556func TestReconcileContainers_ExitedIsNoop(t *testing.T) {
557 svc := types.ServiceConfig{Name: "web", Scale: intPtr(1)}

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected