Fix Flaky Consul Catalog tests.

This commit is contained in:
Ludovic Fernandez 2017-12-13 11:54:03 +01:00 committed by Traefiker
parent 328be161d6
commit 5f6c5025d5

View file

@ -60,13 +60,6 @@ func TestGetPrefixedName(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 {
desc string
@ -119,6 +112,14 @@ func TestGetFrontendRule(t *testing.T) {
t.Run(test.desc, func(t *testing.T) {
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)
assert.Equal(t, test.expected, actual)
})