test: clear env vars so tests use git config for repo URL
All checks were successful
Push Validation / validate (push) Successful in 1m47s

This commit is contained in:
Micheal Wilkinson
2026-03-20 22:04:30 +00:00
parent 68e4211fbf
commit a96fc562a7

View File

@@ -21,6 +21,10 @@ func TestPrepareSuite(t *testing.T) {
func (s *PrepareSuite) SetupTest() { func (s *PrepareSuite) SetupTest() {
s.rootDir = s.T().TempDir() s.rootDir = s.T().TempDir()
// Clear environment variables that take precedence over git config
s.T().Setenv("GITHUB_SERVER_URL", "")
s.T().Setenv("GITHUB_REPOSITORY", "")
require.NoError(s.T(), os.MkdirAll(filepath.Join(s.rootDir, ".git"), 0o755)) require.NoError(s.T(), os.MkdirAll(filepath.Join(s.rootDir, ".git"), 0o755))
require.NoError(s.T(), os.WriteFile( require.NoError(s.T(), os.WriteFile(
filepath.Join(s.rootDir, ".git", "config"), filepath.Join(s.rootDir, ".git", "config"),