From 65b083471737769583846cdd4e8207f4ca8a555b Mon Sep 17 00:00:00 2001 From: David Roe Date: Thu, 12 Oct 2023 13:09:08 +0100 Subject: [PATCH] test: ignore bearer env vars in e2e tests --- e2e/internal/testhelper/testhelper.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/e2e/internal/testhelper/testhelper.go b/e2e/internal/testhelper/testhelper.go index 91c30a275..d49a363aa 100644 --- a/e2e/internal/testhelper/testhelper.go +++ b/e2e/internal/testhelper/testhelper.go @@ -97,10 +97,23 @@ func CreateCommand(arguments []string) (*exec.Cmd, context.CancelFunc) { } cmd.Dir = GetCWD() + cmd.Env = getEnvironment() return cmd, cancel } +func getEnvironment() []string { + var result []string + + for _, variable := range os.Environ() { + if !strings.HasPrefix(variable, "BEARER_") { + result = append(result, variable) + } + } + + return result +} + func executablePath() string { if value, ok := os.LookupEnv("BEARER_EXECUTABLE_PATH"); ok { return value