From 79bd3ca73ecdc7612480f2b300ed1ebb5808ddff Mon Sep 17 00:00:00 2001 From: Nicolas De Loof Date: Wed, 28 Oct 2026 09:12:40 +0100 Subject: [PATCH] test(e2e): add StdoutEmpty check A command that is a no-op (e.g. start on an already running service) must stay silent on stdout. The legacy tests asserted it by hand; expose it as a generic observable of the scenario vocabulary. Signed-off-by: Nicolas De Loof --- pkg/e2e/checks.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pkg/e2e/checks.go b/pkg/e2e/checks.go index 238e529be..a33432c1b 100644 --- a/pkg/e2e/checks.go +++ b/pkg/e2e/checks.go @@ -151,6 +151,20 @@ func OutputNotContains(sub string) Check { } } +// StdoutEmpty expects the command to have written nothing to stdout, for +// commands that must stay silent on a no-op (progress goes to stderr). +func StdoutEmpty() Check { + return Check{ + name: "stdout is empty", + fn: func(ctx *CheckContext) error { + if out := ctx.result.Stdout(); out != "" { + return fmt.Errorf("unexpected stdout: %q", out) + } + return nil + }, + } +} + // ExitCode expects the step's command to have exited with the given code. // Only meaningful on a MayFail action: without MayFail, any non-zero exit // already fails the step before checks run.