Skip to content

Commit 42bf05f

Browse files
author
Emma Turetsky
committed
Moved the resetting of configDir into the runner of TestCreateFedTok
1 parent f47669b commit 42bf05f

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

director/fed_token_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,6 @@ func TestCreateFedTok(t *testing.T) {
178178
server_utils.ResetTestState()
179179
defer server_utils.ResetTestState()
180180

181-
kDir := filepath.Join(t.TempDir(), "keys")
182-
viper.Set(param.IssuerKeysDirectory.GetName(), kDir)
183-
viper.Set("ConfigDir", t.TempDir())
184-
185181
testCases := []struct {
186182
name string
187183
host string
@@ -223,10 +219,14 @@ func TestCreateFedTok(t *testing.T) {
223219

224220
for _, tc := range testCases {
225221
t.Run(tc.name, func(t *testing.T) {
226-
// config.ResetFederationForTest()
227222
w := httptest.NewRecorder()
228223
c, _ := gin.CreateTestContext(w)
229224

225+
confDir := t.TempDir()
226+
kDir := filepath.Join(confDir, "keys")
227+
viper.Set(param.IssuerKeysDirectory.GetName(), kDir)
228+
viper.Set("ConfigDir", confDir)
229+
230230
config.ResetFederationForTest()
231231
fed := pelican_url.FederationDiscovery{
232232
// Most of these aren't actually used by the test, but to prevent auto discovery

0 commit comments

Comments
 (0)