Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
Signed-off-by: Leonardo Luz Almeida <[email protected]>
  • Loading branch information
leoluz committed Oct 22, 2024
1 parent 71c8f0f commit 0837dac
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions server/extension/extension_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,16 @@ func TestRegisterExtensions(t *testing.T) {
t.Parallel()
f := setup()
settings := &settings.ArgoCDSettings{
ExtensionConfig: getExtensionConfigString(),
ExtensionConfig: map[string]string{
"": getExtensionConfigString(),
"another-ext": getSingleExtensionConfigString(),
},
}
f.settingsGetterMock.On("Get", mock.Anything).Return(settings, nil)
expectedProxyRegistries := []string{
"external-backend",
"some-backend",
"another-ext",
}

// when
Expand Down Expand Up @@ -223,7 +227,9 @@ func TestRegisterExtensions(t *testing.T) {
t.Parallel()
f := setup()
settings := &settings.ArgoCDSettings{
ExtensionConfig: tc.configYaml,
ExtensionConfig: map[string]string{
"": tc.configYaml,
},
}
f.settingsGetterMock.On("Get", mock.Anything).Return(settings, nil)

Expand Down Expand Up @@ -362,8 +368,10 @@ func TestCallExtension(t *testing.T) {
secrets["extension.auth.header2"] = "Bearer another-bearer-token"

settings := &settings.ArgoCDSettings{
ExtensionConfig: configYaml,
Secrets: secrets,
ExtensionConfig: map[string]string{
"": configYaml,
},
Secrets: secrets,
}
f.settingsGetterMock.On("Get", mock.Anything).Return(settings, nil)
}
Expand Down Expand Up @@ -796,6 +804,17 @@ extensions:
`
}

func getSingleExtensionConfigString() string {
return `
connectionTimeout: 10s
keepAlive: 11s
idleConnectionTimeout: 12s
maxIdleConnections: 30
services:
- url: http://localhost:7777
`
}

func getExtensionConfigNoService() string {
return `
extensions:
Expand Down

0 comments on commit 0837dac

Please sign in to comment.