Fix broken api test for service Meta (logical conflict rom OSS). Add test that would make this much easier to catch in future.
This commit is contained in:
parent
bd5eb8b749
commit
73f2a49ef1
|
@ -175,6 +175,7 @@ func (s *HTTPServer) AgentServices(resp http.ResponseWriter, req *http.Request)
|
|||
ID: s.ID,
|
||||
Service: s.Service,
|
||||
Tags: s.Tags,
|
||||
Meta: s.Meta,
|
||||
Port: s.Port,
|
||||
Address: s.Address,
|
||||
EnableTagOverride: s.EnableTagOverride,
|
||||
|
|
|
@ -56,6 +56,9 @@ func TestAgent_Services(t *testing.T) {
|
|||
ID: "mysql",
|
||||
Service: "mysql",
|
||||
Tags: []string{"master"},
|
||||
Meta: map[string]string{
|
||||
"foo": "bar",
|
||||
},
|
||||
Port: 5000,
|
||||
}
|
||||
require.NoError(t, a.State.AddService(srv1, ""))
|
||||
|
@ -81,6 +84,7 @@ func TestAgent_Services(t *testing.T) {
|
|||
val := obj.(map[string]*api.AgentService)
|
||||
assert.Lenf(t, val, 1, "bad services: %v", obj)
|
||||
assert.Equal(t, 5000, val["mysql"].Port)
|
||||
assert.Equal(t, srv1.Meta, val["mysql"].Meta)
|
||||
assert.NotNil(t, val["mysql"].Connect)
|
||||
assert.NotNil(t, val["mysql"].Connect.Proxy)
|
||||
assert.Equal(t, prxy1.ExecMode.String(), string(val["mysql"].Connect.Proxy.ExecMode))
|
||||
|
|
Loading…
Reference in New Issue