diff --git a/local/e2e/compose/compose_test.go b/local/e2e/compose/compose_test.go index e0f8d2286..d878fbe48 100644 --- a/local/e2e/compose/compose_test.go +++ b/local/e2e/compose/compose_test.go @@ -53,7 +53,7 @@ func TestLocalComposeUp(t *testing.T) { c.RunDockerCmd("compose", "-f", "./fixtures/sentences/compose.yaml", "--project-name", projectName, "up", "-d") }) - t.Run("check running project", func(t *testing.T) { + t.Run("check accessing running app", func(t *testing.T) { res := c.RunDockerCmd("compose", "-p", projectName, "ps") res.Assert(t, icmd.Expected{Out: `web`}) @@ -89,6 +89,12 @@ func TestLocalComposeUp(t *testing.T) { }) + t.Run("check healthcheck display", func(t *testing.T) { + c.WaitForCmdResult(c.NewDockerCmd("compose", "-p", projectName, "ps", "--format", "json"), + StdoutContains(`"Name":"compose-e2e-demo_web_1","Project":"compose-e2e-demo","Service":"web","State":"running","Health":"healthy"`), + 5*time.Second, 1*time.Second) + }) + t.Run("down", func(t *testing.T) { _ = c.RunDockerCmd("compose", "--project-name", projectName, "down") }) diff --git a/local/e2e/compose/fixtures/sentences/compose.yaml b/local/e2e/compose/fixtures/sentences/compose.yaml index 42bc5cfaa..74d5ce38b 100644 --- a/local/e2e/compose/fixtures/sentences/compose.yaml +++ b/local/e2e/compose/fixtures/sentences/compose.yaml @@ -11,3 +11,6 @@ services: - "90:80" labels: - "my-label=test" + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:80/"] + interval: 5s