From d490be922e418824e70397a1701bd5d8f73ab29d Mon Sep 17 00:00:00 2001 From: Michal Nowacki Date: Mon, 6 May 2024 11:54:56 -0400 Subject: [PATCH] fixup! 800b45a43ae46043ecdf1f1f0692de7af3fff4ed Change the behavior of `ENV[k]` substitution and have values from `ENVIRONMENT` directive take precedence over OS env vars. This gives more control over test execution environment and explicit overrides of OS env vars. --- daemon/internal/newrelic/integration/test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/daemon/internal/newrelic/integration/test.go b/daemon/internal/newrelic/integration/test.go index e4ebd5d4c..478c349fc 100644 --- a/daemon/internal/newrelic/integration/test.go +++ b/daemon/internal/newrelic/integration/test.go @@ -289,9 +289,9 @@ func (t *Test) subEnvVars(in []byte) []byte { re := regexp.MustCompile("ENV\\[.*?\\]") return re.ReplaceAllFunc(in, func(match []byte) []byte { k := string(match[4 : len(match)-1]) - v, present := os.LookupEnv(k) + v, present := t.Env[k] if !present { - v = t.Env[k] + v = os.Getenv(k) } return []byte(v) })