test: upgrade docker-compose
Co-authored-by: Rémi Buisson <remi.buisson@traefik.io>
This commit is contained in:
parent
525a6cf5b2
commit
5a225b4196
81 changed files with 2094 additions and 1283 deletions
|
@ -12,47 +12,49 @@ import (
|
|||
|
||||
type TracingSuite struct {
|
||||
BaseSuite
|
||||
WhoAmiIP string
|
||||
WhoAmiPort int
|
||||
IP string
|
||||
whoamiIP string
|
||||
whoamiPort int
|
||||
tracerIP string
|
||||
}
|
||||
|
||||
type TracingTemplate struct {
|
||||
WhoAmiIP string
|
||||
WhoAmiPort int
|
||||
WhoamiIP string
|
||||
WhoamiPort int
|
||||
IP string
|
||||
TraceContextHeaderName string
|
||||
}
|
||||
|
||||
func (s *TracingSuite) SetUpSuite(c *check.C) {
|
||||
s.createComposeProject(c, "tracing")
|
||||
s.composeProject.Start(c, "whoami")
|
||||
s.composeUp(c)
|
||||
|
||||
s.WhoAmiIP = s.composeProject.Container(c, "whoami").NetworkSettings.IPAddress
|
||||
s.WhoAmiPort = 80
|
||||
s.whoamiIP = s.getComposeServiceIP(c, "whoami")
|
||||
s.whoamiPort = 80
|
||||
}
|
||||
|
||||
func (s *TracingSuite) startZipkin(c *check.C) {
|
||||
s.composeProject.Start(c, "zipkin")
|
||||
s.IP = s.composeProject.Container(c, "zipkin").NetworkSettings.IPAddress
|
||||
s.composeUp(c, "zipkin")
|
||||
s.tracerIP = s.getComposeServiceIP(c, "zipkin")
|
||||
|
||||
// Wait for Zipkin to turn ready.
|
||||
err := try.GetRequest("http://"+s.IP+":9411/api/v2/services", 20*time.Second, try.StatusCodeIs(http.StatusOK))
|
||||
err := try.GetRequest("http://"+s.tracerIP+":9411/api/v2/services", 20*time.Second, try.StatusCodeIs(http.StatusOK))
|
||||
c.Assert(err, checker.IsNil)
|
||||
}
|
||||
|
||||
func (s *TracingSuite) TestZipkinRateLimit(c *check.C) {
|
||||
s.startZipkin(c)
|
||||
defer s.composeProject.Stop(c, "zipkin")
|
||||
// defer s.composeStop(c, "zipkin")
|
||||
|
||||
file := s.adaptFile(c, "fixtures/tracing/simple-zipkin.toml", TracingTemplate{
|
||||
WhoAmiIP: s.WhoAmiIP,
|
||||
WhoAmiPort: s.WhoAmiPort,
|
||||
IP: s.IP,
|
||||
WhoamiIP: s.whoamiIP,
|
||||
WhoamiPort: s.whoamiPort,
|
||||
IP: s.tracerIP,
|
||||
})
|
||||
defer os.Remove(file)
|
||||
|
||||
cmd, display := s.traefikCmd(withConfigFile(file))
|
||||
defer display(c)
|
||||
|
||||
err := cmd.Start()
|
||||
c.Assert(err, checker.IsNil)
|
||||
defer s.killCmd(cmd)
|
||||
|
@ -87,17 +89,18 @@ func (s *TracingSuite) TestZipkinRateLimit(c *check.C) {
|
|||
err = try.GetRequest("http://127.0.0.1:8000/ratelimit", 500*time.Millisecond, try.StatusCodeIs(http.StatusTooManyRequests))
|
||||
c.Assert(err, checker.IsNil)
|
||||
|
||||
err = try.GetRequest("http://"+s.IP+":9411/api/v2/spans?serviceName=tracing", 20*time.Second, try.BodyContains("forward service1/router1@file", "ratelimit-1@file"))
|
||||
err = try.GetRequest("http://"+s.tracerIP+":9411/api/v2/spans?serviceName=tracing", 20*time.Second, try.BodyContains("forward service1/router1@file", "ratelimit-1@file"))
|
||||
c.Assert(err, checker.IsNil)
|
||||
}
|
||||
|
||||
func (s *TracingSuite) TestZipkinRetry(c *check.C) {
|
||||
s.startZipkin(c)
|
||||
defer s.composeProject.Stop(c, "zipkin")
|
||||
defer s.composeStop(c, "zipkin")
|
||||
|
||||
file := s.adaptFile(c, "fixtures/tracing/simple-zipkin.toml", TracingTemplate{
|
||||
WhoAmiIP: s.WhoAmiIP,
|
||||
WhoAmiPort: 81,
|
||||
IP: s.IP,
|
||||
WhoamiIP: s.whoamiIP,
|
||||
WhoamiPort: 81,
|
||||
IP: s.tracerIP,
|
||||
})
|
||||
defer os.Remove(file)
|
||||
|
||||
|
@ -114,17 +117,18 @@ func (s *TracingSuite) TestZipkinRetry(c *check.C) {
|
|||
err = try.GetRequest("http://127.0.0.1:8000/retry", 500*time.Millisecond, try.StatusCodeIs(http.StatusBadGateway))
|
||||
c.Assert(err, checker.IsNil)
|
||||
|
||||
err = try.GetRequest("http://"+s.IP+":9411/api/v2/spans?serviceName=tracing", 20*time.Second, try.BodyContains("forward service2/router2@file", "retry@file"))
|
||||
err = try.GetRequest("http://"+s.tracerIP+":9411/api/v2/spans?serviceName=tracing", 20*time.Second, try.BodyContains("forward service2/router2@file", "retry@file"))
|
||||
c.Assert(err, checker.IsNil)
|
||||
}
|
||||
|
||||
func (s *TracingSuite) TestZipkinAuth(c *check.C) {
|
||||
s.startZipkin(c)
|
||||
defer s.composeProject.Stop(c, "zipkin")
|
||||
defer s.composeStop(c, "zipkin")
|
||||
|
||||
file := s.adaptFile(c, "fixtures/tracing/simple-zipkin.toml", TracingTemplate{
|
||||
WhoAmiIP: s.WhoAmiIP,
|
||||
WhoAmiPort: s.WhoAmiPort,
|
||||
IP: s.IP,
|
||||
WhoamiIP: s.whoamiIP,
|
||||
WhoamiPort: s.whoamiPort,
|
||||
IP: s.tracerIP,
|
||||
})
|
||||
defer os.Remove(file)
|
||||
|
||||
|
@ -141,26 +145,27 @@ func (s *TracingSuite) TestZipkinAuth(c *check.C) {
|
|||
err = try.GetRequest("http://127.0.0.1:8000/auth", 500*time.Millisecond, try.StatusCodeIs(http.StatusUnauthorized))
|
||||
c.Assert(err, checker.IsNil)
|
||||
|
||||
err = try.GetRequest("http://"+s.IP+":9411/api/v2/spans?serviceName=tracing", 20*time.Second, try.BodyContains("entrypoint web", "basic-auth@file"))
|
||||
err = try.GetRequest("http://"+s.tracerIP+":9411/api/v2/spans?serviceName=tracing", 20*time.Second, try.BodyContains("entrypoint web", "basic-auth@file"))
|
||||
c.Assert(err, checker.IsNil)
|
||||
}
|
||||
|
||||
func (s *TracingSuite) startJaeger(c *check.C) {
|
||||
s.composeProject.Start(c, "jaeger")
|
||||
s.IP = s.composeProject.Container(c, "jaeger").NetworkSettings.IPAddress
|
||||
s.composeUp(c, "jaeger", "whoami")
|
||||
s.tracerIP = s.getComposeServiceIP(c, "jaeger")
|
||||
|
||||
// Wait for Jaeger to turn ready.
|
||||
err := try.GetRequest("http://"+s.IP+":16686/api/services", 20*time.Second, try.StatusCodeIs(http.StatusOK))
|
||||
err := try.GetRequest("http://"+s.tracerIP+":16686/api/services", 20*time.Second, try.StatusCodeIs(http.StatusOK))
|
||||
c.Assert(err, checker.IsNil)
|
||||
}
|
||||
|
||||
func (s *TracingSuite) TestJaegerRateLimit(c *check.C) {
|
||||
s.startJaeger(c)
|
||||
defer s.composeProject.Stop(c, "jaeger")
|
||||
defer s.composeStop(c, "jaeger")
|
||||
|
||||
file := s.adaptFile(c, "fixtures/tracing/simple-jaeger.toml", TracingTemplate{
|
||||
WhoAmiIP: s.WhoAmiIP,
|
||||
WhoAmiPort: s.WhoAmiPort,
|
||||
IP: s.IP,
|
||||
WhoamiIP: s.whoamiIP,
|
||||
WhoamiPort: s.whoamiPort,
|
||||
IP: s.tracerIP,
|
||||
TraceContextHeaderName: "uber-trace-id",
|
||||
})
|
||||
defer os.Remove(file)
|
||||
|
@ -200,17 +205,18 @@ func (s *TracingSuite) TestJaegerRateLimit(c *check.C) {
|
|||
err = try.GetRequest("http://127.0.0.1:8000/ratelimit", 500*time.Millisecond, try.StatusCodeIs(http.StatusTooManyRequests))
|
||||
c.Assert(err, checker.IsNil)
|
||||
|
||||
err = try.GetRequest("http://"+s.IP+":16686/api/traces?service=tracing", 20*time.Second, try.BodyContains("forward service1/router1@file", "ratelimit-1@file"))
|
||||
err = try.GetRequest("http://"+s.tracerIP+":16686/api/traces?service=tracing", 20*time.Second, try.BodyContains("forward service1/router1@file", "ratelimit-1@file"))
|
||||
c.Assert(err, checker.IsNil)
|
||||
}
|
||||
|
||||
func (s *TracingSuite) TestJaegerRetry(c *check.C) {
|
||||
s.startJaeger(c)
|
||||
defer s.composeProject.Stop(c, "jaeger")
|
||||
defer s.composeStop(c, "jaeger")
|
||||
|
||||
file := s.adaptFile(c, "fixtures/tracing/simple-jaeger.toml", TracingTemplate{
|
||||
WhoAmiIP: s.WhoAmiIP,
|
||||
WhoAmiPort: 81,
|
||||
IP: s.IP,
|
||||
WhoamiIP: s.whoamiIP,
|
||||
WhoamiPort: 81,
|
||||
IP: s.tracerIP,
|
||||
TraceContextHeaderName: "uber-trace-id",
|
||||
})
|
||||
defer os.Remove(file)
|
||||
|
@ -228,17 +234,18 @@ func (s *TracingSuite) TestJaegerRetry(c *check.C) {
|
|||
err = try.GetRequest("http://127.0.0.1:8000/retry", 500*time.Millisecond, try.StatusCodeIs(http.StatusBadGateway))
|
||||
c.Assert(err, checker.IsNil)
|
||||
|
||||
err = try.GetRequest("http://"+s.IP+":16686/api/traces?service=tracing", 20*time.Second, try.BodyContains("forward service2/router2@file", "retry@file"))
|
||||
err = try.GetRequest("http://"+s.tracerIP+":16686/api/traces?service=tracing", 20*time.Second, try.BodyContains("forward service2/router2@file", "retry@file"))
|
||||
c.Assert(err, checker.IsNil)
|
||||
}
|
||||
|
||||
func (s *TracingSuite) TestJaegerAuth(c *check.C) {
|
||||
s.startJaeger(c)
|
||||
defer s.composeProject.Stop(c, "jaeger")
|
||||
defer s.composeStop(c, "jaeger")
|
||||
|
||||
file := s.adaptFile(c, "fixtures/tracing/simple-jaeger.toml", TracingTemplate{
|
||||
WhoAmiIP: s.WhoAmiIP,
|
||||
WhoAmiPort: s.WhoAmiPort,
|
||||
IP: s.IP,
|
||||
WhoamiIP: s.whoamiIP,
|
||||
WhoamiPort: s.whoamiPort,
|
||||
IP: s.tracerIP,
|
||||
TraceContextHeaderName: "uber-trace-id",
|
||||
})
|
||||
defer os.Remove(file)
|
||||
|
@ -256,17 +263,18 @@ func (s *TracingSuite) TestJaegerAuth(c *check.C) {
|
|||
err = try.GetRequest("http://127.0.0.1:8000/auth", 500*time.Millisecond, try.StatusCodeIs(http.StatusUnauthorized))
|
||||
c.Assert(err, checker.IsNil)
|
||||
|
||||
err = try.GetRequest("http://"+s.IP+":16686/api/traces?service=tracing", 20*time.Second, try.BodyContains("EntryPoint web", "basic-auth@file"))
|
||||
err = try.GetRequest("http://"+s.tracerIP+":16686/api/traces?service=tracing", 20*time.Second, try.BodyContains("EntryPoint web", "basic-auth@file"))
|
||||
c.Assert(err, checker.IsNil)
|
||||
}
|
||||
|
||||
func (s *TracingSuite) TestJaegerCustomHeader(c *check.C) {
|
||||
s.startJaeger(c)
|
||||
defer s.composeProject.Stop(c, "jaeger")
|
||||
defer s.composeStop(c, "jaeger")
|
||||
|
||||
file := s.adaptFile(c, "fixtures/tracing/simple-jaeger.toml", TracingTemplate{
|
||||
WhoAmiIP: s.WhoAmiIP,
|
||||
WhoAmiPort: s.WhoAmiPort,
|
||||
IP: s.IP,
|
||||
WhoamiIP: s.whoamiIP,
|
||||
WhoamiPort: s.whoamiPort,
|
||||
IP: s.tracerIP,
|
||||
TraceContextHeaderName: "powpow",
|
||||
})
|
||||
defer os.Remove(file)
|
||||
|
@ -284,17 +292,18 @@ func (s *TracingSuite) TestJaegerCustomHeader(c *check.C) {
|
|||
err = try.GetRequest("http://127.0.0.1:8000/auth", 500*time.Millisecond, try.StatusCodeIs(http.StatusUnauthorized))
|
||||
c.Assert(err, checker.IsNil)
|
||||
|
||||
err = try.GetRequest("http://"+s.IP+":16686/api/traces?service=tracing", 20*time.Second, try.BodyContains("EntryPoint web", "basic-auth@file"))
|
||||
err = try.GetRequest("http://"+s.tracerIP+":16686/api/traces?service=tracing", 20*time.Second, try.BodyContains("EntryPoint web", "basic-auth@file"))
|
||||
c.Assert(err, checker.IsNil)
|
||||
}
|
||||
|
||||
func (s *TracingSuite) TestJaegerAuthCollector(c *check.C) {
|
||||
s.startJaeger(c)
|
||||
defer s.composeProject.Stop(c, "jaeger")
|
||||
defer s.composeStop(c, "jaeger")
|
||||
|
||||
file := s.adaptFile(c, "fixtures/tracing/simple-jaeger-collector.toml", TracingTemplate{
|
||||
WhoAmiIP: s.WhoAmiIP,
|
||||
WhoAmiPort: s.WhoAmiPort,
|
||||
IP: s.IP,
|
||||
WhoamiIP: s.whoamiIP,
|
||||
WhoamiPort: s.whoamiPort,
|
||||
IP: s.tracerIP,
|
||||
})
|
||||
defer os.Remove(file)
|
||||
|
||||
|
@ -311,6 +320,6 @@ func (s *TracingSuite) TestJaegerAuthCollector(c *check.C) {
|
|||
err = try.GetRequest("http://127.0.0.1:8000/auth", 500*time.Millisecond, try.StatusCodeIs(http.StatusUnauthorized))
|
||||
c.Assert(err, checker.IsNil)
|
||||
|
||||
err = try.GetRequest("http://"+s.IP+":16686/api/traces?service=tracing", 20*time.Second, try.BodyContains("EntryPoint web", "basic-auth@file"))
|
||||
err = try.GetRequest("http://"+s.tracerIP+":16686/api/traces?service=tracing", 20*time.Second, try.BodyContains("EntryPoint web", "basic-auth@file"))
|
||||
c.Assert(err, checker.IsNil)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue