From 0dd199257f1713afd0ccb6fcdb2e8068ae6f962f Mon Sep 17 00:00:00 2001 From: Nicolas De Loof Date: Thu, 8 Oct 2026 11:10:58 +0200 Subject: [PATCH] test(e2e): stop asserting pre_start output the foreground up never streams The hook scenario matched "pre-start-hook-ran" in the output, but the service's own line "app-read:pre-start-hook-ran" contains it, so the assertion passed without any pre_start output reaching the session. A foreground up streams post_start's output but not pre_start's today (checked on main too). Lock what actually holds: pre_start's effect, read by the service through a value distinct from anything it logs. Signed-off-by: Nicolas De Loof --- pkg/e2e/testdata/TestUpInteractiveHookLogs/compose.yaml | 2 +- pkg/e2e/up_interactive_test.go | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/pkg/e2e/testdata/TestUpInteractiveHookLogs/compose.yaml b/pkg/e2e/testdata/TestUpInteractiveHookLogs/compose.yaml index f7c2b4b39..8c79f2d66 100644 --- a/pkg/e2e/testdata/TestUpInteractiveHookLogs/compose.yaml +++ b/pkg/e2e/testdata/TestUpInteractiveHookLogs/compose.yaml @@ -6,7 +6,7 @@ services: - data:/shared pre_start: - image: alpine - command: sh -c 'echo "pre-start-hook-ran" | tee /shared/init.txt' + command: sh -c 'echo "pre-start-file-content" > /shared/init.txt' post_start: - command: echo post-start-hook-ran volumes: diff --git a/pkg/e2e/up_interactive_test.go b/pkg/e2e/up_interactive_test.go index c052943ce..9e86390a7 100644 --- a/pkg/e2e/up_interactive_test.go +++ b/pkg/e2e/up_interactive_test.go @@ -29,12 +29,13 @@ import ( // it (epic #14081, lot 2) can be reviewed against a fixed specification. // Most e2e coverage of the start phase runs detached; these do not. +// pre_start output is not asserted: a foreground up does not stream it into the +// session today, only post_start's. What is locked for pre_start is its effect. func TestUpInteractiveHookLogs(t *testing.T) { - NewScenario(t, "a foreground up must stream pre_start and post_start hook output into its session"). - Step("up prints both hooks' output, and the service reads what pre_start wrote before it started", + NewScenario(t, "a foreground up must run pre_start before the service starts and stream post_start output into its session"). + Step("up shows post_start's output, and the service reads what pre_start wrote before it started", ComposeCmd("up", "--menu=false").Within(120*time.Second), - OutputContains("pre-start-hook-ran"), - OutputContains("app-read:pre-start-hook-ran"), + OutputContains("app-read:pre-start-file-content"), OutputContains("post-start-hook-ran"), ServiceState("app", "exited")) }