Skip to content

Commit

Permalink
Add tests lost during PR 1320.
Browse files Browse the repository at this point in the history
The tests part of this change were originally in PR 1320 but got lost
during one of the rebases. Let's bring them back in.
  • Loading branch information
timoreimann committed May 3, 2017
1 parent e86df01 commit 1dcf8d2
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions provider/marathon/marathon_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,62 @@ func TestMarathonLoadConfig(t *testing.T) {
},
},
},
{
applications: &marathon.Applications{
Apps: []marathon.Application{
{
ID: "/testHealthCheck",
Ports: []int{80},
Labels: &map[string]string{
labelBackendHealthCheckPath: "/path",
labelBackendHealthCheckInterval: "5m",
},
},
},
},
tasks: &marathon.Tasks{
Tasks: []marathon.Task{
{
ID: "testHealthCheck",
AppID: "/testHealthCheck",
Host: "127.0.0.1",
Ports: []int{80},
IPAddresses: []*marathon.IPAddress{
{
IPAddress: "127.0.0.1",
Protocol: "tcp",
},
},
},
},
},
expectedFrontends: map[string]*types.Frontend{
"frontend-testHealthCheck": {
Backend: "backend-testHealthCheck",
PassHostHeader: true,
EntryPoints: []string{},
Routes: map[string]types.Route{
"route-host-testHealthCheck": {
Rule: "Host:testHealthCheck.docker.localhost",
},
},
},
},
expectedBackends: map[string]*types.Backend{
"backend-testHealthCheck": {
Servers: map[string]types.Server{
"server-testHealthCheck": {
URL: "http://127.0.0.1:80",
Weight: 0,
},
},
HealthCheck: &types.HealthCheck{
Path: "/path",
Interval: "5m",
},
},
},
},
}

for _, c := range cases {
Expand Down

0 comments on commit 1dcf8d2

Please sign in to comment.