diff --git a/contrib/executor/artillery/pkg/runner/artillery.go b/contrib/executor/artillery/pkg/runner/artillery.go index 1502eb543c2..9d2e302c32e 100644 --- a/contrib/executor/artillery/pkg/runner/artillery.go +++ b/contrib/executor/artillery/pkg/runner/artillery.go @@ -100,6 +100,8 @@ func (r *ArtilleryRunner) Run(ctx context.Context, execution testkube.Execution) if args[i] == "" { args[i] = path } + + args[i] = os.ExpandEnv(args[i]) } runPath := testDir diff --git a/contrib/executor/curl/pkg/runner/runner.go b/contrib/executor/curl/pkg/runner/runner.go index ef91f46243f..9102f85a9b9 100644 --- a/contrib/executor/curl/pkg/runner/runner.go +++ b/contrib/executor/curl/pkg/runner/runner.go @@ -135,6 +135,9 @@ func (r *CurlRunner) Run(ctx context.Context, execution testkube.Execution) (res } args = append(args, execution.Args...) + for i := range args { + args[i] = os.ExpandEnv(args[i]) + } runPath := workingDir outputPkg.PrintLogf("%s Test run command %s %s", ui.IconRocket, command, strings.Join(args, " ")) diff --git a/contrib/executor/cypress/pkg/runner/cypress.go b/contrib/executor/cypress/pkg/runner/cypress.go index b98c0d6344f..34773f1a242 100644 --- a/contrib/executor/cypress/pkg/runner/cypress.go +++ b/contrib/executor/cypress/pkg/runner/cypress.go @@ -137,6 +137,8 @@ func (r *CypressRunner) Run(ctx context.Context, execution testkube.Execution) ( if args[i] == "" { args[i] = strings.Join(envVars, ",") } + + args[i] = os.ExpandEnv(args[i]) } // run cypress inside repo directory ignore execution error in case of failed test diff --git a/contrib/executor/ginkgo/pkg/runner/runner.go b/contrib/executor/ginkgo/pkg/runner/runner.go index 4b4f17e85ce..549a3d782b2 100644 --- a/contrib/executor/ginkgo/pkg/runner/runner.go +++ b/contrib/executor/ginkgo/pkg/runner/runner.go @@ -296,6 +296,8 @@ func BuildGinkgoArgs(params map[string]string, path, runPath, reportFile string, if args[i] == "" { args[i] = reportFile } + + args[i] = os.ExpandEnv(args[i]) } output.PrintLogf("%s Ginkgo arguments from params built: %s", ui.IconCheckMark, args) diff --git a/contrib/executor/gradle/pkg/runner/runner.go b/contrib/executor/gradle/pkg/runner/runner.go index b171fc035b2..28b8eb09aa5 100644 --- a/contrib/executor/gradle/pkg/runner/runner.go +++ b/contrib/executor/gradle/pkg/runner/runner.go @@ -131,6 +131,7 @@ func (r *GradleRunner) Run(ctx context.Context, execution testkube.Execution) (r if args[i] == "" { args[i] = project } + args[i] = os.ExpandEnv(args[i]) } diff --git a/contrib/executor/jmeter/pkg/runner/runner.go b/contrib/executor/jmeter/pkg/runner/runner.go index d3b1e0db775..2ebf78e56e5 100644 --- a/contrib/executor/jmeter/pkg/runner/runner.go +++ b/contrib/executor/jmeter/pkg/runner/runner.go @@ -151,6 +151,10 @@ func (r *JMeterRunner) Run(ctx context.Context, execution testkube.Execution) (r } } + for i := range args { + args[i] = os.ExpandEnv(args[i]) + } + output.PrintLogf("%s Using arguments: %v", ui.IconWorld, args) entryPoint := getEntryPoint() diff --git a/contrib/executor/jmeterd/pkg/runner/runner.go b/contrib/executor/jmeterd/pkg/runner/runner.go index 6192863b588..7221a489f0e 100644 --- a/contrib/executor/jmeterd/pkg/runner/runner.go +++ b/contrib/executor/jmeterd/pkg/runner/runner.go @@ -191,6 +191,10 @@ func (r *JMeterDRunner) Run(ctx context.Context, execution testkube.Execution) ( } } + for i := range args { + args[i] = os.ExpandEnv(args[i]) + } + output.PrintLogf("%s Using arguments: %v", ui.IconWorld, args) entryPoint := getEntryPoint() diff --git a/contrib/executor/k6/pkg/runner/runner.go b/contrib/executor/k6/pkg/runner/runner.go index 8e64c950fb2..8266ad8750c 100644 --- a/contrib/executor/k6/pkg/runner/runner.go +++ b/contrib/executor/k6/pkg/runner/runner.go @@ -165,6 +165,10 @@ func (r *K6Runner) Run(ctx context.Context, execution testkube.Execution) (resul } } + for i := range args { + args[i] = os.ExpandEnv(args[i]) + } + command, args := executor.MergeCommandAndArgs(execution.Command, args) outputPkg.PrintEvent("Running", directory, command, args) runPath := directory diff --git a/contrib/executor/kubepug/pkg/runner/runner.go b/contrib/executor/kubepug/pkg/runner/runner.go index a3bf3c95e5d..a626c2c402d 100644 --- a/contrib/executor/kubepug/pkg/runner/runner.go +++ b/contrib/executor/kubepug/pkg/runner/runner.go @@ -191,6 +191,8 @@ func buildArgs(args []string, inputPath string) ([]string, error) { if args[i] == "" { args[i] = inputPath } + + args[i] = os.ExpandEnv(args[i]) } return args, nil } diff --git a/contrib/executor/maven/pkg/runner/runner.go b/contrib/executor/maven/pkg/runner/runner.go index c36f420ce51..c700b181cc7 100644 --- a/contrib/executor/maven/pkg/runner/runner.go +++ b/contrib/executor/maven/pkg/runner/runner.go @@ -159,6 +159,8 @@ func (r *MavenRunner) Run(ctx context.Context, execution testkube.Execution) (re if args[i] == "" { args[i] = mavenHome } + + args[i] = os.ExpandEnv(args[i]) } outputPkg.PrintEvent("Running goal: "+goal, mavenHome, mavenCommand, args) diff --git a/contrib/executor/playwright/pkg/runner/playwright.go b/contrib/executor/playwright/pkg/runner/playwright.go index f2be7a1ecc3..bcd6b8b4247 100644 --- a/contrib/executor/playwright/pkg/runner/playwright.go +++ b/contrib/executor/playwright/pkg/runner/playwright.go @@ -97,6 +97,8 @@ func (r *PlaywrightRunner) Run(ctx context.Context, execution testkube.Execution if args[i] == "" { args[i] = depCommand } + + args[i] = os.ExpandEnv(args[i]) } envManager := env.NewManagerWithVars(execution.Variables) diff --git a/contrib/executor/postman/pkg/runner/newman/newman.go b/contrib/executor/postman/pkg/runner/newman/newman.go index 7346a769bdd..083568ab053 100644 --- a/contrib/executor/postman/pkg/runner/newman/newman.go +++ b/contrib/executor/postman/pkg/runner/newman/newman.go @@ -124,6 +124,8 @@ func (r *NewmanRunner) Run(ctx context.Context, execution testkube.Execution) (r if args[i] == "" { args[i] = path } + + args[i] = os.ExpandEnv(args[i]) } runPath := "" diff --git a/contrib/executor/soapui/pkg/runner/runner.go b/contrib/executor/soapui/pkg/runner/runner.go index e17da2c0707..a9f90a4eb60 100644 --- a/contrib/executor/soapui/pkg/runner/runner.go +++ b/contrib/executor/soapui/pkg/runner/runner.go @@ -127,6 +127,8 @@ func setUpEnvironment(args []string, testFilePath string) { if args[i] == "" { args[i] = testFilePath } + + args[i] = os.ExpandEnv(args[i]) } os.Setenv("COMMAND_LINE", strings.Join(args, " ")) } diff --git a/contrib/executor/tracetest/pkg/runner/runner.go b/contrib/executor/tracetest/pkg/runner/runner.go index 33614b565d3..bc4e8a09bc4 100644 --- a/contrib/executor/tracetest/pkg/runner/runner.go +++ b/contrib/executor/tracetest/pkg/runner/runner.go @@ -3,6 +3,7 @@ package runner import ( "context" "fmt" + "os" "strings" "github.com/kubeshop/testkube/contrib/executor/tracetest/pkg/model" @@ -151,6 +152,8 @@ func buildArgs(args []string, tracetestEndpoint string, inputPath string) ([]str if args[i] == "" { args[i] = inputPath } + + args[i] = os.ExpandEnv(args[i]) } return args, nil } diff --git a/contrib/executor/zap/pkg/runner/runner.go b/contrib/executor/zap/pkg/runner/runner.go index cb06b59b200..9d6bdc2b130 100644 --- a/contrib/executor/zap/pkg/runner/runner.go +++ b/contrib/executor/zap/pkg/runner/runner.go @@ -255,5 +255,10 @@ func MergeArgs(fileArgs []string, reportFile string, execution testkube.Executio break } } + + for i := range args { + args[i] = os.ExpandEnv(args[i]) + } + return args }