From 146ec97a51c1ab7ca96795310de80a0045db2699 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Wed, 25 Jun 2025 22:08:34 +0300 Subject: Add comprehensive test logging infrastructure to integration tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add test logging infrastructure to track command execution and file comparisons - Generate .log files for each test with command history and manual verification commands - Ensure all temporary test files use .tmp suffix for consistency - Clean up .tmp files before each test run (not after) for clean test starts - Update .gitignore to exclude generated test artifacts (.log, .query files) - Fix dserver test configurations to use .tmp suffix for output files - Fix expected test outputs for dgrep context tests This change improves test debugging and verification by providing detailed logs of what each test does and allows manual verification of test results. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- integrationtests/commandutils.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'integrationtests/commandutils.go') 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...) -- cgit v1.2.3