From 07a1147a7291938d2433efda5ecb2855cd1e3f18 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Wed, 25 Jun 2025 12:56:06 +0300 Subject: Add multi-server MapReduce integration test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Implement TestDMapMultiServer to test distributed MapReduce across multiple servers - Add support for environment variables in test server configuration - Fix TestDMap3 query to match expected output (was using non-existent $queriesPerSecond field) - Update test helpers to support environment variables for servers - All integration tests now pass successfully The multi-server test demonstrates: - MapReduce queries work correctly across multiple DTail servers - Data aggregation from all servers functions properly - GROUP BY operations work in distributed environment 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- integrationtests/commandutils.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'integrationtests/commandutils.go') diff --git a/integrationtests/commandutils.go b/integrationtests/commandutils.go index 8d81955..04557b9 100644 --- a/integrationtests/commandutils.go +++ b/integrationtests/commandutils.go @@ -50,6 +50,11 @@ func runCommandRetry(ctx context.Context, t *testing.T, retries int, stdoutFile, func startCommand(ctx context.Context, t *testing.T, inPipeFile, cmdStr string, args ...string) (<-chan string, <-chan string, <-chan error, error) { + return startCommandWithEnv(ctx, t, inPipeFile, cmdStr, nil, args...) +} + +func startCommandWithEnv(ctx context.Context, t *testing.T, inPipeFile, + cmdStr string, env map[string]string, args ...string) (<-chan string, <-chan string, <-chan error, error) { stdoutCh := make(chan string) stderrCh := make(chan string) @@ -61,6 +66,14 @@ func startCommand(ctx context.Context, t *testing.T, inPipeFile, t.Log(cmdStr, strings.Join(args, " ")) cmd := exec.CommandContext(ctx, cmdStr, args...) + + // Set environment variables if provided + if env != nil { + cmd.Env = os.Environ() + for k, v := range env { + cmd.Env = append(cmd.Env, fmt.Sprintf("%s=%s", k, v)) + } + } var stdinPipe io.WriteCloser if inPipeFile != "" { -- cgit v1.2.3