summaryrefslogtreecommitdiff
path: root/integrationtests/commandutils.go
diff options
context:
space:
mode:
Diffstat (limited to 'integrationtests/commandutils.go')
-rw-r--r--integrationtests/commandutils.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/integrationtests/commandutils.go b/integrationtests/commandutils.go
index 04557b9..763e76f 100644
--- a/integrationtests/commandutils.go
+++ b/integrationtests/commandutils.go
@@ -20,6 +20,11 @@ func runCommand(ctx context.Context, t *testing.T, stdoutFile, cmdStr string,
return 0, fmt.Errorf("no such executable '%s', please compile first: %w", cmdStr, err)
}
+ // Log command execution if logger is available
+ if logger := GetTestLogger(ctx); logger != nil {
+ logger.LogCommand(cmdStr, args)
+ }
+
t.Log("Creating stdout file", stdoutFile)
fd, err := os.Create(stdoutFile)
if err != nil {
@@ -64,6 +69,11 @@ func startCommandWithEnv(ctx context.Context, t *testing.T, inPipeFile,
fmt.Errorf("no such executable '%s', please compile first: %w", cmdStr, err)
}
+ // Log command execution if logger is available
+ if logger := GetTestLogger(ctx); logger != nil {
+ logger.LogCommand(cmdStr, args)
+ }
+
t.Log(cmdStr, strings.Join(args, " "))
cmd := exec.CommandContext(ctx, cmdStr, args...)