Skip to content

Commit 2430c39

Browse files
Copilotlpcox
andauthored
Strengthen tests to verify GITHUB_ENV is ignored
Agent-Logs-Url: https://github.com/github/gh-aw-mcpg/sessions/6579536c-4790-47dc-8c0c-eed5aaaf2030 Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
1 parent d676b90 commit 2430c39

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

internal/cmd/proxy_test.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,7 @@ func TestConfigureTLSTrustEnvironment(t *testing.T) {
415415

416416
t.Run("sets trust environment variables in process", func(t *testing.T) {
417417
assert := assert.New(t)
418+
t.Setenv("GITHUB_ENV", "")
418419
for _, key := range tlsTrustEnvKeys {
419420
t.Setenv(key, "")
420421
}
@@ -428,8 +429,17 @@ func TestConfigureTLSTrustEnvironment(t *testing.T) {
428429
})
429430

430431
t.Run("does not rely on GITHUB_ENV", func(t *testing.T) {
431-
t.Setenv("GITHUB_ENV", "/path/that/does/not/exist/github_env")
432+
assert := assert.New(t)
433+
githubEnvFile := t.TempDir() + "/github_env"
434+
const original = "UNCHANGED=1\n"
435+
require.NoError(t, os.WriteFile(githubEnvFile, []byte(original), 0o644))
436+
t.Setenv("GITHUB_ENV", githubEnvFile)
437+
432438
require.NoError(t, configureTLSTrustEnvironment(caPath))
439+
440+
content, err := os.ReadFile(githubEnvFile)
441+
require.NoError(t, err)
442+
assert.Equal(original, string(content))
433443
})
434444

435445
t.Run("rejects CA cert path with newline", func(t *testing.T) {

0 commit comments

Comments
 (0)