From 92e107f52ddea709fa91ebb4ee1df304331cfc7a Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Mon, 11 Sep 2023 21:25:57 +0200 Subject: [PATCH] Use constant for WAIT_FOR_DEBUGGER env var --- pkg/integration/clients/injector/main.go | 2 +- pkg/integration/components/runner.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/integration/clients/injector/main.go b/pkg/integration/clients/injector/main.go index 63c3e2a07..223ff4ecb 100644 --- a/pkg/integration/clients/injector/main.go +++ b/pkg/integration/clients/injector/main.go @@ -31,7 +31,7 @@ func main() { integrationTest := getIntegrationTest() - if os.Getenv("WAIT_FOR_DEBUGGER") != "" { + if os.Getenv(components.WAIT_FOR_DEBUGGER_ENV_VAR) != "" { println("Waiting for debugger to attach...") for !isDebuggerAttached() { time.Sleep(time.Millisecond * 100) diff --git a/pkg/integration/components/runner.go b/pkg/integration/components/runner.go index 09b01a71c..d84ee4a22 100644 --- a/pkg/integration/components/runner.go +++ b/pkg/integration/components/runner.go @@ -16,6 +16,7 @@ import ( const ( TEST_NAME_ENV_VAR = "TEST_NAME" SANDBOX_ENV_VAR = "SANDBOX" + WAIT_FOR_DEBUGGER_ENV_VAR = "WAIT_FOR_DEBUGGER" GIT_CONFIG_GLOBAL_ENV_VAR = "GIT_CONFIG_GLOBAL" ) @@ -215,7 +216,7 @@ func getLazygitCommand(test *IntegrationTest, paths Paths, rootDir string, sandb cmdObj.AddEnvVars(fmt.Sprintf("%s=%s", SANDBOX_ENV_VAR, "true")) } if waitForDebugger { - cmdObj.AddEnvVars("WAIT_FOR_DEBUGGER=true") + cmdObj.AddEnvVars(fmt.Sprintf("%s=true", WAIT_FOR_DEBUGGER_ENV_VAR)) } // Set a race detector log path only to avoid spamming the terminal with the // logs. We are not showing this anywhere yet.