Fix Flaky Consul Catalog tests.
This commit is contained in:
parent
328be161d6
commit
5f6c5025d5
1 changed files with 8 additions and 7 deletions
|
@ -60,13 +60,6 @@ func TestGetPrefixedName(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestGetFrontendRule(t *testing.T) {
|
func TestGetFrontendRule(t *testing.T) {
|
||||||
provider := &CatalogProvider{
|
|
||||||
Domain: "localhost",
|
|
||||||
Prefix: "traefik",
|
|
||||||
FrontEndRule: "Host:{{.ServiceName}}.{{.Domain}}",
|
|
||||||
frontEndRuleTemplate: template.New("consul catalog frontend rule"),
|
|
||||||
}
|
|
||||||
provider.setupFrontEndTemplate()
|
|
||||||
|
|
||||||
testCases := []struct {
|
testCases := []struct {
|
||||||
desc string
|
desc string
|
||||||
|
@ -119,6 +112,14 @@ func TestGetFrontendRule(t *testing.T) {
|
||||||
t.Run(test.desc, func(t *testing.T) {
|
t.Run(test.desc, func(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
|
provider := &CatalogProvider{
|
||||||
|
Domain: "localhost",
|
||||||
|
Prefix: "traefik",
|
||||||
|
FrontEndRule: "Host:{{.ServiceName}}.{{.Domain}}",
|
||||||
|
frontEndRuleTemplate: template.New("consul catalog frontend rule"),
|
||||||
|
}
|
||||||
|
provider.setupFrontEndTemplate()
|
||||||
|
|
||||||
actual := provider.getFrontendRule(test.service)
|
actual := provider.getFrontendRule(test.service)
|
||||||
assert.Equal(t, test.expected, actual)
|
assert.Equal(t, test.expected, actual)
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue