From a1d9d438492f70115a18173f5970ca9581cc60ac Mon Sep 17 00:00:00 2001 From: John Murret Date: Mon, 18 Nov 2024 17:05:38 -0700 Subject: [PATCH] update test descriptions to make more sense --- agent/agent_endpoint_test.go | 6 +++--- agent/consul/catalog_endpoint_test.go | 10 +++++----- agent/consul/config_endpoint_test.go | 2 +- agent/consul/health_endpoint_test.go | 8 ++++---- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/agent/agent_endpoint_test.go b/agent/agent_endpoint_test.go index bab3765130..451c412b4b 100644 --- a/agent/agent_endpoint_test.go +++ b/agent/agent_endpoint_test.go @@ -474,7 +474,7 @@ func TestAgent_Services_ACLFilter(t *testing.T) { require.NotEmpty(t, resp.Header().Get("X-Consul-Results-Filtered-By-ACLs")) }) - t.Run("request with filter that would match only service without any token returns zero results and ResultsFilteredByACLs equal to false", func(t *testing.T) { + t.Run("request with filter that would normally match but without any token returns zero results and ResultsFilteredByACLs equal to false", func(t *testing.T) { req, _ := http.NewRequest("GET", "/v1/agent/services?filter="+url.QueryEscape(bexprNotMatchingUserTokenPermissions), nil) resp := httptest.NewRecorder() a.srv.h.ServeHTTP(resp, req) @@ -1525,7 +1525,7 @@ func TestAgent_Checks_ACLFilter(t *testing.T) { require.NotEmpty(t, resp.Header().Get("X-Consul-Results-Filtered-By-ACLs")) }) - t.Run("request with filter that would match only service without any token returns zero results and ResultsFilteredByACLs equal to false", func(t *testing.T) { + t.Run("request with filter that would normally match but without any token returns zero results and ResultsFilteredByACLs equal to false", func(t *testing.T) { req, _ := http.NewRequest("GET", "/v1/agent/checks?filter="+url.QueryEscape(bexprNotMatchingUserTokenPermissions), nil) resp := httptest.NewRecorder() a.srv.h.ServeHTTP(resp, req) @@ -2254,7 +2254,7 @@ func TestAgent_Members_ACLFilter(t *testing.T) { require.NotEmpty(t, resp.Header().Get("X-Consul-Results-Filtered-By-ACLs")) }) - t.Run("request with filter that would match only service without any token returns zero results and ResultsFilteredByACLs equal to false", func(t *testing.T) { + t.Run("request with filter that would normally match but without any token returns zero results and ResultsFilteredByACLs equal to false", func(t *testing.T) { req, _ := http.NewRequest("GET", "/v1/agent/members?filter="+url.QueryEscape(bexprNotMatchingUserTokenPermissions), nil) resp := httptest.NewRecorder() a.srv.h.ServeHTTP(resp, req) diff --git a/agent/consul/catalog_endpoint_test.go b/agent/consul/catalog_endpoint_test.go index 557c00702a..1f3311b0cd 100644 --- a/agent/consul/catalog_endpoint_test.go +++ b/agent/consul/catalog_endpoint_test.go @@ -1450,7 +1450,7 @@ func TestCatalog_ListNodes_ACLFilter(t *testing.T) { require.True(t, reply.ResultsFilteredByACLs) }) - t.Run("request with filter that would match only service without any token returns zero results and ResultsFilteredByACLs equal to false", func(t *testing.T) { + t.Run("request with filter that would normally match but without any token returns zero results and ResultsFilteredByACLs equal to false", func(t *testing.T) { var reply structs.IndexedNodes args = structs.DCSpecificRequest{ Datacenter: "dc1", @@ -3081,7 +3081,7 @@ func TestCatalog_ListServices_FilterACL(t *testing.T) { require.True(t, reply.ResultsFilteredByACLs) }) - t.Run("request with filter that would match only service without any token returns zero results and ResultsFilteredByACLs equal to false", func(t *testing.T) { + t.Run("request with filter that would normally match but without any token returns zero results and ResultsFilteredByACLs equal to false", func(t *testing.T) { req := structs.DCSpecificRequest{ Datacenter: "dc1", QueryOptions: structs.QueryOptions{ @@ -3204,7 +3204,7 @@ func TestCatalog_ServiceNodes_FilterACL(t *testing.T) { require.True(t, reply.ResultsFilteredByACLs) }) - t.Run("request with filter that would match only service without any token returns zero results and ResultsFilteredByACLs equal to false", func(t *testing.T) { + t.Run("request with filter that would normally match but without any token returns zero results and ResultsFilteredByACLs equal to false", func(t *testing.T) { opt = structs.ServiceSpecificRequest{ Datacenter: "dc1", ServiceName: "foo", @@ -3346,7 +3346,7 @@ func TestCatalog_NodeServices_FilterACL(t *testing.T) { require.True(t, reply.ResultsFilteredByACLs) }) - t.Run("request with filter that would match only service without any token returns zero results and ResultsFilteredByACLs equal to false", func(t *testing.T) { + t.Run("request with filter that would normally match but without any token returns zero results and ResultsFilteredByACLs equal to false", func(t *testing.T) { req := structs.NodeSpecificRequest{ Datacenter: "dc1", Node: srv.config.NodeName, @@ -3425,7 +3425,7 @@ func TestCatalog_NodeServicesList_FilterACL(t *testing.T) { require.True(t, reply.ResultsFilteredByACLs) }) - t.Run("request with filter that would match only service without any token returns zero results and ResultsFilteredByACLs equal to false", func(t *testing.T) { + t.Run("request with filter that would normally match but without any token returns zero results and ResultsFilteredByACLs equal to false", func(t *testing.T) { req := structs.NodeSpecificRequest{ Datacenter: "dc1", Node: srv.config.NodeName, diff --git a/agent/consul/config_endpoint_test.go b/agent/consul/config_endpoint_test.go index 20df533b3c..cf503ee525 100644 --- a/agent/consul/config_endpoint_test.go +++ b/agent/consul/config_endpoint_test.go @@ -865,7 +865,7 @@ operator = "read" require.True(t, reply.ResultsFilteredByACLs) }) - t.Run("request with filter that would match only service without any token returns zero results and ResultsFilteredByACLs equal to false", func(t *testing.T) { + t.Run("request with filter that would normally match but without any token returns zero results and ResultsFilteredByACLs equal to false", func(t *testing.T) { args = structs.ConfigEntryQuery{ Kind: structs.ServiceDefaults, Datacenter: s1.config.Datacenter, diff --git a/agent/consul/health_endpoint_test.go b/agent/consul/health_endpoint_test.go index 6960d3aff9..fef8d285a6 100644 --- a/agent/consul/health_endpoint_test.go +++ b/agent/consul/health_endpoint_test.go @@ -1566,7 +1566,7 @@ func TestHealth_NodeChecks_FilterACL(t *testing.T) { require.True(t, reply.ResultsFilteredByACLs) }) - t.Run("request with filter that would match only service without any token returns zero results and ResultsFilteredByACLs equal to false", func(t *testing.T) { + t.Run("request with filter that would normally match but without any token returns zero results and ResultsFilteredByACLs equal to false", func(t *testing.T) { opt := structs.NodeSpecificRequest{ Datacenter: "dc1", Node: srv.config.NodeName, @@ -1678,7 +1678,7 @@ func TestHealth_ServiceChecks_FilterACL(t *testing.T) { require.True(t, reply.ResultsFilteredByACLs) }) - t.Run("request with filter that would match only service without any token returns zero results and ResultsFilteredByACLs equal to false", func(t *testing.T) { + t.Run("request with filter that would normally match but without any token returns zero results and ResultsFilteredByACLs equal to false", func(t *testing.T) { opt := structs.ServiceSpecificRequest{ Datacenter: "dc1", ServiceName: "foo", @@ -1780,7 +1780,7 @@ func TestHealth_ServiceNodes_FilterACL(t *testing.T) { require.True(t, reply.ResultsFilteredByACLs) }) - t.Run("request with filter that would match only service without any token returns zero results and ResultsFilteredByACLs equal to false", func(t *testing.T) { + t.Run("request with filter that would normally match but without any token returns zero results and ResultsFilteredByACLs equal to false", func(t *testing.T) { opt := structs.ServiceSpecificRequest{ Datacenter: "dc1", ServiceName: "foo", @@ -1867,7 +1867,7 @@ func TestHealth_ChecksInState_FilterACL(t *testing.T) { require.True(t, reply.ResultsFilteredByACLs) }) - t.Run("request with filter that would match only service without any token returns zero results and ResultsFilteredByACLs equal to false", func(t *testing.T) { + t.Run("request with filter that would normally match but without any token returns zero results and ResultsFilteredByACLs equal to false", func(t *testing.T) { req := structs.ChecksInStateRequest{ Datacenter: "dc1", State: api.HealthPassing,