end-to-end test

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
Nicolas De Loof 2025-06-02 17:59:11 +02:00 committed by Nicolas De loof
parent 3ca75bdf55
commit 27e90a3fdf
3 changed files with 31 additions and 1 deletions

View File

@ -191,7 +191,6 @@ func (c *convergence) ensureService(ctx context.Context, project *types.Project,
case ContainerCreated:
case ContainerRestarting:
case ContainerExited:
w.Event(progress.CreatedEvent(name))
default:
container := container
eg.Go(tracing.EventWrapFuncForErrGroup(ctx, "service/start", tracing.ContainerOptions(container), func(ctx context.Context) error {

View File

@ -0,0 +1,10 @@
services:
web:
image: nginx
networks:
- test
networks:
test:
labels:
- foo=${FOO:-foo}

View File

@ -199,3 +199,24 @@ func TestInterfaceName(t *testing.T) {
})
res.Assert(t, icmd.Expected{Out: "foobar@"})
}
func TestNetworkRecreate(t *testing.T) {
c := NewCLI(t)
const projectName = "network_recreate"
t.Cleanup(func() {
c.cleanupWithDown(t, projectName)
})
c.RunDockerComposeCmd(t, "-f", "./fixtures/network-recreate/compose.yaml", "--project-name", projectName, "up", "-d")
c = NewCLI(t, WithEnv("FOO=bar"))
res := c.RunDockerComposeCmd(t, "-f", "./fixtures/network-recreate/compose.yaml", "--project-name", projectName, "--progress=plain", "up", "-d")
err := res.Stderr()
fmt.Println(err)
res.Assert(t, icmd.Expected{Err: `
Container network_recreate-web-1 Stopped
Network network_recreate_test Removed
Network network_recreate_test Creating
Network network_recreate_test Created
Container network_recreate-web-1 Starting
Container network_recreate-web-1 Started`})
}