diff --git a/internal/mode/static/nginx/config/base_http_config_test.go b/internal/mode/static/nginx/config/base_http_config_test.go index 408118ecbc..f06c4aa725 100644 --- a/internal/mode/static/nginx/config/base_http_config_test.go +++ b/internal/mode/static/nginx/config/base_http_config_test.go @@ -10,6 +10,7 @@ import ( ) func TestExecuteBaseHttp(t *testing.T) { + t.Parallel() confOn := dataplane.Configuration{ BaseHTTPConfig: dataplane.BaseHTTPConfig{ HTTP2: true, @@ -42,13 +43,16 @@ func TestExecuteBaseHttp(t *testing.T) { } for _, test := range tests { - g := NewWithT(t) - - res := executeBaseHTTPConfig(test.conf) - g.Expect(res).To(HaveLen(1)) - g.Expect(test.expCount).To(Equal(strings.Count(string(res[0].data), expSubStr))) - g.Expect(strings.Count(string(res[0].data), "map $http_host $gw_api_compliant_host {")).To(Equal(1)) - g.Expect(strings.Count(string(res[0].data), "map $http_upgrade $connection_upgrade {")).To(Equal(1)) - g.Expect(strings.Count(string(res[0].data), "map $request_uri $request_uri_path {")).To(Equal(1)) + t.Run(test.name, func(t *testing.T) { + t.Parallel() + g := NewWithT(t) + + res := executeBaseHTTPConfig(test.conf) + g.Expect(res).To(HaveLen(1)) + g.Expect(test.expCount).To(Equal(strings.Count(string(res[0].data), expSubStr))) + g.Expect(strings.Count(string(res[0].data), "map $http_host $gw_api_compliant_host {")).To(Equal(1)) + g.Expect(strings.Count(string(res[0].data), "map $http_upgrade $connection_upgrade {")).To(Equal(1)) + g.Expect(strings.Count(string(res[0].data), "map $request_uri $request_uri_path {")).To(Equal(1)) + }) } } diff --git a/internal/mode/static/nginx/config/convert_test.go b/internal/mode/static/nginx/config/convert_test.go index 0a3a059fac..6be41ccda6 100644 --- a/internal/mode/static/nginx/config/convert_test.go +++ b/internal/mode/static/nginx/config/convert_test.go @@ -10,6 +10,7 @@ import ( ) func TestConvertEndpoints(t *testing.T) { + t.Parallel() endpoints := []resolver.Endpoint{ { Address: "1.2.3.4", diff --git a/internal/mode/static/nginx/config/generator_test.go b/internal/mode/static/nginx/config/generator_test.go index f3eefa35f5..4940d72452 100644 --- a/internal/mode/static/nginx/config/generator_test.go +++ b/internal/mode/static/nginx/config/generator_test.go @@ -15,6 +15,7 @@ import ( ) func TestGenerate(t *testing.T) { + t.Parallel() bg := dataplane.BackendGroup{ Source: types.NamespacedName{Namespace: "test", Name: "hr"}, RuleIdx: 0, diff --git a/internal/mode/static/nginx/config/maps_test.go b/internal/mode/static/nginx/config/maps_test.go index a5227fb9b8..af94f77d0a 100644 --- a/internal/mode/static/nginx/config/maps_test.go +++ b/internal/mode/static/nginx/config/maps_test.go @@ -12,6 +12,7 @@ import ( ) func TestExecuteMaps(t *testing.T) { + t.Parallel() g := NewWithT(t) pathRules := []dataplane.PathRule{ { @@ -97,6 +98,7 @@ func TestExecuteMaps(t *testing.T) { } func TestBuildAddHeaderMaps(t *testing.T) { + t.Parallel() g := NewWithT(t) pathRules := []dataplane.PathRule{ { @@ -190,6 +192,7 @@ func TestBuildAddHeaderMaps(t *testing.T) { } func TestExecuteStreamMaps(t *testing.T) { + t.Parallel() g := NewWithT(t) conf := dataplane.Configuration{ TLSPassthroughServers: []dataplane.Layer4VirtualServer{ @@ -257,6 +260,7 @@ func TestExecuteStreamMaps(t *testing.T) { } func TestCreateStreamMaps(t *testing.T) { + t.Parallel() g := NewWithT(t) conf := dataplane.Configuration{ TLSPassthroughServers: []dataplane.Layer4VirtualServer{ @@ -371,6 +375,7 @@ func TestCreateStreamMaps(t *testing.T) { } func TestCreateStreamMapsWithEmpty(t *testing.T) { + t.Parallel() g := NewWithT(t) conf := dataplane.Configuration{ TLSPassthroughServers: nil, diff --git a/internal/mode/static/nginx/config/servers_test.go b/internal/mode/static/nginx/config/servers_test.go index e3a9122b23..515908c76f 100644 --- a/internal/mode/static/nginx/config/servers_test.go +++ b/internal/mode/static/nginx/config/servers_test.go @@ -18,6 +18,7 @@ import ( ) func TestExecuteServers(t *testing.T) { + t.Parallel() conf := dataplane.Configuration{ HTTPServers: []dataplane.VirtualServer{ { @@ -145,6 +146,7 @@ func TestExecuteServers(t *testing.T) { } func TestExecuteServers_IPFamily(t *testing.T) { + t.Parallel() httpServers := []dataplane.VirtualServer{ { IsDefault: true, @@ -267,6 +269,7 @@ func TestExecuteServers_IPFamily(t *testing.T) { for _, test := range tests { t.Run(test.msg, func(t *testing.T) { + t.Parallel() g := NewWithT(t) gen := GeneratorImpl{} @@ -284,6 +287,7 @@ func TestExecuteServers_IPFamily(t *testing.T) { } func TestExecuteServers_RewriteClientIP(t *testing.T) { + t.Parallel() httpServers := []dataplane.VirtualServer{ { IsDefault: true, @@ -383,6 +387,7 @@ func TestExecuteServers_RewriteClientIP(t *testing.T) { for _, test := range tests { t.Run(test.msg, func(t *testing.T) { + t.Parallel() g := NewWithT(t) gen := GeneratorImpl{} @@ -400,6 +405,7 @@ func TestExecuteServers_RewriteClientIP(t *testing.T) { } func TestExecuteServers_Plus(t *testing.T) { + t.Parallel() config := dataplane.Configuration{ HTTPServers: []dataplane.VirtualServer{ { @@ -438,6 +444,7 @@ func TestExecuteServers_Plus(t *testing.T) { } func TestExecuteForDefaultServers(t *testing.T) { + t.Parallel() testcases := []struct { msg string httpPorts []int @@ -506,6 +513,7 @@ func TestExecuteForDefaultServers(t *testing.T) { for _, tc := range testcases { t.Run(tc.msg, func(t *testing.T) { + t.Parallel() g := NewWithT(t) gen := GeneratorImpl{} @@ -527,6 +535,7 @@ func TestExecuteForDefaultServers(t *testing.T) { } func TestCreateServers(t *testing.T) { + t.Parallel() const ( sslKeyPairID = "test-keypair" ) @@ -1498,6 +1507,7 @@ func modifyMatchPairs(matchPairs httpMatchPairs) httpMatchPairs { } func TestCreateServersConflicts(t *testing.T) { + t.Parallel() fooGroup := dataplane.BackendGroup{ Source: types.NamespacedName{Namespace: "test", Name: "route"}, RuleIdx: 0, @@ -1671,6 +1681,7 @@ func TestCreateServersConflicts(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { + t.Parallel() httpServers := []dataplane.VirtualServer{ { IsDefault: true, @@ -1703,6 +1714,7 @@ func TestCreateServersConflicts(t *testing.T) { } func TestCreateLocationsRootPath(t *testing.T) { + t.Parallel() hrNsName := types.NamespacedName{Namespace: "test", Name: "route1"} fooGroup := dataplane.BackendGroup{ @@ -1869,6 +1881,7 @@ func TestCreateLocationsRootPath(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { + t.Parallel() g := NewWithT(t) locs, httpMatchPair, grpc := createLocations(&dataplane.VirtualServer{ @@ -1883,6 +1896,7 @@ func TestCreateLocationsRootPath(t *testing.T) { } func TestCreateReturnValForRedirectFilter(t *testing.T) { + t.Parallel() const listenerPortCustom = 123 const listenerPortHTTP = 80 const listenerPortHTTPS = 443 @@ -2005,6 +2019,7 @@ func TestCreateReturnValForRedirectFilter(t *testing.T) { for _, test := range tests { t.Run(test.msg, func(t *testing.T) { + t.Parallel() g := NewWithT(t) result := createReturnValForRedirectFilter(test.filter, test.listenerPort) @@ -2014,6 +2029,7 @@ func TestCreateReturnValForRedirectFilter(t *testing.T) { } func TestCreateRewritesValForRewriteFilter(t *testing.T) { + t.Parallel() tests := []struct { filter *dataplane.HTTPURLRewriteFilter expected *rewriteConfig @@ -2131,6 +2147,7 @@ func TestCreateRewritesValForRewriteFilter(t *testing.T) { for _, test := range tests { t.Run(test.msg, func(t *testing.T) { + t.Parallel() g := NewWithT(t) result := createRewritesValForRewriteFilter(test.filter, test.path) @@ -2140,6 +2157,7 @@ func TestCreateRewritesValForRewriteFilter(t *testing.T) { } func TestCreateRouteMatch(t *testing.T) { + t.Parallel() testPath := "/internal_loc" testMethodMatch := helpers.GetPointer("PUT") @@ -2290,6 +2308,7 @@ func TestCreateRouteMatch(t *testing.T) { } for _, tc := range tests { t.Run(tc.msg, func(t *testing.T) { + t.Parallel() g := NewWithT(t) result := createRouteMatch(tc.match, testPath) @@ -2299,6 +2318,7 @@ func TestCreateRouteMatch(t *testing.T) { } func TestCreateQueryParamKeyValString(t *testing.T) { + t.Parallel() g := NewWithT(t) expected := "key=value" @@ -2325,6 +2345,7 @@ func TestCreateQueryParamKeyValString(t *testing.T) { } func TestCreateHeaderKeyValString(t *testing.T) { + t.Parallel() g := NewWithT(t) expected := "kEy:vALUe" @@ -2340,6 +2361,7 @@ func TestCreateHeaderKeyValString(t *testing.T) { } func TestIsPathOnlyMatch(t *testing.T) { + t.Parallel() tests := []struct { msg string match dataplane.Match @@ -2385,6 +2407,7 @@ func TestIsPathOnlyMatch(t *testing.T) { for _, tc := range tests { t.Run(tc.msg, func(t *testing.T) { + t.Parallel() g := NewWithT(t) result := isPathOnlyMatch(tc.match) @@ -2394,7 +2417,7 @@ func TestIsPathOnlyMatch(t *testing.T) { } func TestCreateProxyPass(t *testing.T) { - g := NewWithT(t) + t.Parallel() tests := []struct { rewrite *dataplane.HTTPURLRewriteFilter @@ -2463,12 +2486,17 @@ func TestCreateProxyPass(t *testing.T) { } for _, tc := range tests { - result := createProxyPass(tc.grp, tc.rewrite, generateProtocolString(nil, tc.GRPC), tc.GRPC) - g.Expect(result).To(Equal(tc.expected)) + t.Run(tc.expected, func(t *testing.T) { + t.Parallel() + g := NewWithT(t) + result := createProxyPass(tc.grp, tc.rewrite, generateProtocolString(nil, tc.GRPC), tc.GRPC) + g.Expect(result).To(Equal(tc.expected)) + }) } } func TestCreateMatchLocation(t *testing.T) { + t.Parallel() g := NewWithT(t) expectedNoGRPC := http.Location{ @@ -2492,6 +2520,7 @@ func TestCreateMatchLocation(t *testing.T) { } func TestGenerateProxySetHeaders(t *testing.T) { + t.Parallel() tests := []struct { filters *dataplane.HTTPFilters msg string @@ -2685,6 +2714,7 @@ func TestGenerateProxySetHeaders(t *testing.T) { for _, tc := range tests { t.Run(tc.msg, func(t *testing.T) { + t.Parallel() g := NewWithT(t) headers := generateProxySetHeaders(tc.filters, tc.GRPC) @@ -2694,7 +2724,7 @@ func TestGenerateProxySetHeaders(t *testing.T) { } func TestConvertBackendTLSFromGroup(t *testing.T) { - g := NewWithT(t) + t.Parallel() tests := []struct { expected *http.ProxySSLVerify @@ -2775,7 +2805,10 @@ func TestConvertBackendTLSFromGroup(t *testing.T) { } for _, tc := range tests { - t.Run(tc.msg, func(_ *testing.T) { + t.Run(tc.msg, func(t *testing.T) { + t.Parallel() + g := NewWithT(t) + result := createProxyTLSFromBackends(tc.grp) g.Expect(result).To(Equal(tc.expected)) }) @@ -2783,6 +2816,7 @@ func TestConvertBackendTLSFromGroup(t *testing.T) { } func TestGenerateResponseHeaders(t *testing.T) { + t.Parallel() tests := []struct { filters *dataplane.HTTPFilters msg string @@ -2842,6 +2876,7 @@ func TestGenerateResponseHeaders(t *testing.T) { for _, tc := range tests { t.Run(tc.msg, func(t *testing.T) { + t.Parallel() g := NewWithT(t) headers := generateResponseHeaders(tc.filters) @@ -2851,6 +2886,7 @@ func TestGenerateResponseHeaders(t *testing.T) { } func TestCreateIncludesFromPolicyGenerateResult(t *testing.T) { + t.Parallel() tests := []struct { name string files []policies.File @@ -2896,6 +2932,7 @@ func TestCreateIncludesFromPolicyGenerateResult(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { + t.Parallel() g := NewWithT(t) includes := createIncludesFromPolicyGenerateResult(test.files) @@ -2905,6 +2942,7 @@ func TestCreateIncludesFromPolicyGenerateResult(t *testing.T) { } func TestCreateIncludeFileResults(t *testing.T) { + t.Parallel() servers := []http.Server{ { Includes: []http.Include{ @@ -2995,6 +3033,7 @@ func TestCreateIncludeFileResults(t *testing.T) { } func TestGetIPFamily(t *testing.T) { + t.Parallel() test := []struct { msg string baseHTTPConfig dataplane.BaseHTTPConfig @@ -3019,7 +3058,9 @@ func TestGetIPFamily(t *testing.T) { for _, tc := range test { t.Run(tc.msg, func(t *testing.T) { + t.Parallel() g := NewWithT(t) + result := getIPFamily(tc.baseHTTPConfig) g.Expect(result).To(Equal(tc.expected)) }) diff --git a/internal/mode/static/nginx/config/sockets_test.go b/internal/mode/static/nginx/config/sockets_test.go index cbab84aea3..96d2bca036 100644 --- a/internal/mode/static/nginx/config/sockets_test.go +++ b/internal/mode/static/nginx/config/sockets_test.go @@ -7,6 +7,7 @@ import ( ) func TestGetSocketNameTLS(t *testing.T) { + t.Parallel() res := getSocketNameTLS(800, "*.cafe.example.com") g := NewGomegaWithT(t) @@ -14,6 +15,7 @@ func TestGetSocketNameTLS(t *testing.T) { } func TestGetSocketNameHTTPS(t *testing.T) { + t.Parallel() res := getSocketNameHTTPS(800) g := NewGomegaWithT(t) @@ -21,6 +23,7 @@ func TestGetSocketNameHTTPS(t *testing.T) { } func TestGetTLSPassthroughVarName(t *testing.T) { + t.Parallel() res := getTLSPassthroughVarName(800) g := NewGomegaWithT(t) diff --git a/internal/mode/static/nginx/config/split_clients_test.go b/internal/mode/static/nginx/config/split_clients_test.go index 9ee6785ca9..44eebf359b 100644 --- a/internal/mode/static/nginx/config/split_clients_test.go +++ b/internal/mode/static/nginx/config/split_clients_test.go @@ -11,6 +11,7 @@ import ( ) func TestExecuteSplitClients(t *testing.T) { + t.Parallel() bg1 := dataplane.BackendGroup{ Source: types.NamespacedName{Namespace: "test", Name: "hr"}, RuleIdx: 0, @@ -97,6 +98,7 @@ func TestExecuteSplitClients(t *testing.T) { for _, test := range tests { t.Run(test.msg, func(t *testing.T) { + t.Parallel() g := NewWithT(t) splitResults := executeSplitClients(dataplane.Configuration{BackendGroups: test.backendGroups}) g.Expect(splitResults).To(HaveLen(1)) @@ -115,6 +117,7 @@ func TestExecuteSplitClients(t *testing.T) { } func TestCreateSplitClients(t *testing.T) { + t.Parallel() hrNoSplit := types.NamespacedName{Namespace: "test", Name: "hr-no-split"} hrOneSplit := types.NamespacedName{Namespace: "test", Name: "hr-one-split"} hrTwoSplits := types.NamespacedName{Namespace: "test", Name: "hr-two-splits"} @@ -241,6 +244,7 @@ func TestCreateSplitClients(t *testing.T) { for _, test := range tests { t.Run(test.msg, func(t *testing.T) { + t.Parallel() g := NewWithT(t) result := createSplitClients(test.backendGroups) g.Expect(result).To(Equal(test.expSplitClients)) @@ -249,6 +253,7 @@ func TestCreateSplitClients(t *testing.T) { } func TestCreateSplitClientDistributions(t *testing.T) { + t.Parallel() tests := []struct { msg string backends []dataplane.Backend @@ -388,6 +393,7 @@ func TestCreateSplitClientDistributions(t *testing.T) { for _, test := range tests { t.Run(test.msg, func(t *testing.T) { + t.Parallel() g := NewWithT(t) result := createSplitClientDistributions(dataplane.BackendGroup{Backends: test.backends}) g.Expect(result).To(Equal(test.expDistributions)) @@ -396,6 +402,7 @@ func TestCreateSplitClientDistributions(t *testing.T) { } func TestGetSplitClientValue(t *testing.T) { + t.Parallel() tests := []struct { msg string expValue string @@ -421,6 +428,7 @@ func TestGetSplitClientValue(t *testing.T) { for _, test := range tests { t.Run(test.msg, func(t *testing.T) { + t.Parallel() g := NewWithT(t) result := getSplitClientValue(test.backend) g.Expect(result).To(Equal(test.expValue)) @@ -429,6 +437,7 @@ func TestGetSplitClientValue(t *testing.T) { } func TestPercentOf(t *testing.T) { + t.Parallel() tests := []struct { msg string weight int32 @@ -493,6 +502,7 @@ func TestPercentOf(t *testing.T) { for _, test := range tests { t.Run(test.msg, func(t *testing.T) { + t.Parallel() g := NewWithT(t) percent := percentOf(test.weight, test.totalWeight) g.Expect(percent).To(Equal(test.expPercent)) @@ -501,6 +511,7 @@ func TestPercentOf(t *testing.T) { } func TestBackendGroupNeedsSplit(t *testing.T) { + t.Parallel() tests := []struct { msg string backends []dataplane.Backend @@ -574,6 +585,7 @@ func TestBackendGroupNeedsSplit(t *testing.T) { for _, test := range tests { t.Run(test.msg, func(t *testing.T) { + t.Parallel() g := NewWithT(t) bg := dataplane.BackendGroup{ Source: types.NamespacedName{Namespace: "test", Name: "hr"}, @@ -586,6 +598,7 @@ func TestBackendGroupNeedsSplit(t *testing.T) { } func TestBackendGroupName(t *testing.T) { + t.Parallel() tests := []struct { msg string expName string @@ -670,6 +683,7 @@ func TestBackendGroupName(t *testing.T) { for _, test := range tests { t.Run(test.msg, func(t *testing.T) { + t.Parallel() g := NewWithT(t) bg := dataplane.BackendGroup{ Source: types.NamespacedName{Namespace: "test", Name: "hr"}, diff --git a/internal/mode/static/nginx/config/stream_servers_test.go b/internal/mode/static/nginx/config/stream_servers_test.go index 322e474e2f..1e5c8b6606 100644 --- a/internal/mode/static/nginx/config/stream_servers_test.go +++ b/internal/mode/static/nginx/config/stream_servers_test.go @@ -13,6 +13,7 @@ import ( ) func TestExecuteStreamServers(t *testing.T) { + t.Parallel() conf := dataplane.Configuration{ TLSPassthroughServers: []dataplane.Layer4VirtualServer{ { @@ -74,6 +75,7 @@ func TestExecuteStreamServers(t *testing.T) { } func TestExecuteStreamServers_Plus(t *testing.T) { + t.Parallel() config := dataplane.Configuration{ TLSPassthroughServers: []dataplane.Layer4VirtualServer{ { @@ -112,6 +114,7 @@ func TestExecuteStreamServers_Plus(t *testing.T) { } func TestCreateStreamServers(t *testing.T) { + t.Parallel() conf := dataplane.Configuration{ TLSPassthroughServers: []dataplane.Layer4VirtualServer{ { @@ -214,6 +217,7 @@ func TestCreateStreamServers(t *testing.T) { } func TestExecuteStreamServersForIPFamily(t *testing.T) { + t.Parallel() passThroughServers := []dataplane.Layer4VirtualServer{ { UpstreamName: "backend1", @@ -283,6 +287,7 @@ func TestExecuteStreamServersForIPFamily(t *testing.T) { for _, test := range tests { t.Run(test.msg, func(t *testing.T) { + t.Parallel() g := NewWithT(t) gen := GeneratorImpl{} @@ -298,6 +303,7 @@ func TestExecuteStreamServersForIPFamily(t *testing.T) { } func TestExecuteStreamServers_RewriteClientIP(t *testing.T) { + t.Parallel() passThroughServers := []dataplane.Layer4VirtualServer{ { UpstreamName: "backend1", @@ -378,6 +384,7 @@ func TestExecuteStreamServers_RewriteClientIP(t *testing.T) { for _, test := range tests { t.Run(test.msg, func(t *testing.T) { + t.Parallel() g := NewWithT(t) gen := GeneratorImpl{} @@ -393,6 +400,7 @@ func TestExecuteStreamServers_RewriteClientIP(t *testing.T) { } func TestCreateStreamServersWithNone(t *testing.T) { + t.Parallel() conf := dataplane.Configuration{ TLSPassthroughServers: nil, } diff --git a/internal/mode/static/nginx/config/telemetry_test.go b/internal/mode/static/nginx/config/telemetry_test.go index 6d59c1abac..5838152985 100644 --- a/internal/mode/static/nginx/config/telemetry_test.go +++ b/internal/mode/static/nginx/config/telemetry_test.go @@ -10,6 +10,7 @@ import ( ) func TestExecuteTelemetry(t *testing.T) { + t.Parallel() conf := dataplane.Configuration{ Telemetry: dataplane.Telemetry{ Endpoint: "1.2.3.4:123", @@ -50,6 +51,7 @@ func TestExecuteTelemetry(t *testing.T) { } func TestExecuteTelemetryNil(t *testing.T) { + t.Parallel() conf := dataplane.Configuration{ Telemetry: dataplane.Telemetry{}, } diff --git a/internal/mode/static/nginx/config/upstreams_test.go b/internal/mode/static/nginx/config/upstreams_test.go index 8ec1c33386..b3f8d16981 100644 --- a/internal/mode/static/nginx/config/upstreams_test.go +++ b/internal/mode/static/nginx/config/upstreams_test.go @@ -12,6 +12,7 @@ import ( ) func TestExecuteUpstreams(t *testing.T) { + t.Parallel() gen := GeneratorImpl{} stateUpstreams := []dataplane.Upstream{ { @@ -72,6 +73,7 @@ func TestExecuteUpstreams(t *testing.T) { } func TestCreateUpstreams(t *testing.T) { + t.Parallel() gen := GeneratorImpl{} stateUpstreams := []dataplane.Upstream{ { @@ -175,6 +177,7 @@ func TestCreateUpstreams(t *testing.T) { } func TestCreateUpstream(t *testing.T) { + t.Parallel() gen := GeneratorImpl{} tests := []struct { msg string @@ -274,6 +277,7 @@ func TestCreateUpstream(t *testing.T) { for _, test := range tests { t.Run(test.msg, func(t *testing.T) { + t.Parallel() g := NewWithT(t) result := gen.createUpstream(test.stateUpstream) g.Expect(result).To(Equal(test.expectedUpstream)) @@ -282,6 +286,7 @@ func TestCreateUpstream(t *testing.T) { } func TestCreateUpstreamPlus(t *testing.T) { + t.Parallel() gen := GeneratorImpl{plus: true} stateUpstream := dataplane.Upstream{ @@ -310,6 +315,7 @@ func TestCreateUpstreamPlus(t *testing.T) { } func TestExecuteStreamUpstreams(t *testing.T) { + t.Parallel() gen := GeneratorImpl{} stateUpstreams := []dataplane.Upstream{ { @@ -355,6 +361,7 @@ func TestExecuteStreamUpstreams(t *testing.T) { } func TestCreateStreamUpstreams(t *testing.T) { + t.Parallel() gen := GeneratorImpl{} stateUpstreams := []dataplane.Upstream{ { @@ -429,6 +436,7 @@ func TestCreateStreamUpstreams(t *testing.T) { } func TestCreateStreamUpstream(t *testing.T) { + t.Parallel() gen := GeneratorImpl{} up := dataplane.Upstream{ Name: "multiple-endpoints", @@ -470,6 +478,7 @@ func TestCreateStreamUpstream(t *testing.T) { } func TestCreateStreamUpstreamPlus(t *testing.T) { + t.Parallel() gen := GeneratorImpl{plus: true} stateUpstream := dataplane.Upstream{ diff --git a/internal/mode/static/nginx/config/variable_names_test.go b/internal/mode/static/nginx/config/variable_names_test.go index acaebe9aa2..629d6a183d 100644 --- a/internal/mode/static/nginx/config/variable_names_test.go +++ b/internal/mode/static/nginx/config/variable_names_test.go @@ -7,6 +7,7 @@ import ( ) func TestConvertStringToSafeVariableName(t *testing.T) { + t.Parallel() tests := []struct { msg string s string @@ -25,6 +26,7 @@ func TestConvertStringToSafeVariableName(t *testing.T) { } for _, test := range tests { t.Run(test.msg, func(t *testing.T) { + t.Parallel() g := NewWithT(t) g.Expect(convertStringToSafeVariableName(test.s)).To(Equal(test.expected)) }) @@ -32,6 +34,7 @@ func TestConvertStringToSafeVariableName(t *testing.T) { } func TestGenerateAddHeaderMapVariableName(t *testing.T) { + t.Parallel() tests := []struct { msg string headerName string @@ -50,6 +53,7 @@ func TestGenerateAddHeaderMapVariableName(t *testing.T) { } for _, test := range tests { t.Run(test.msg, func(t *testing.T) { + t.Parallel() g := NewWithT(t) actual := generateAddHeaderMapVariableName(test.headerName) g.Expect(actual).To(Equal(test.expected)) diff --git a/internal/mode/static/nginx/config/version_test.go b/internal/mode/static/nginx/config/version_test.go index 4219844c39..176db3dfec 100644 --- a/internal/mode/static/nginx/config/version_test.go +++ b/internal/mode/static/nginx/config/version_test.go @@ -8,6 +8,7 @@ import ( ) func TestExecuteVersion(t *testing.T) { + t.Parallel() g := NewWithT(t) expSubStrings := map[string]int{ "return 200 42;": 1,