Skip to content

Commit 45c6863

Browse files
author
Copyberry
committed
Sync from Copyberry
GitOrigin-RevId: f88a51c0edd22b0ba2792877f767a01f66c1ff5f
1 parent c01eb9d commit 45c6863

2 files changed

Lines changed: 0 additions & 19 deletions

File tree

pkg/config/adapter_test.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -483,10 +483,8 @@ health:
483483
},
484484
}
485485
for _, flavor := range adapterRuntimeFlavors() {
486-
flavor := flavor
487486
t.Run(string(flavor), func(t *testing.T) {
488487
for _, tc := range cases {
489-
tc := tc
490488
t.Run(tc.name, func(t *testing.T) {
491489
full, runtime := loadParityPairForFlavor(t, tc.args, lookupEnvMap(tc.env), flavor)
492490
assertSharedRuntimeParity(t, full, runtime)
@@ -510,10 +508,8 @@ func TestFullAndRuntimeAcceptDefaultEquivalentFullOnlyEnvironment(t *testing.T)
510508
{name: "HARPOON_CAPTURE_PAYLOADS", value: "false"},
511509
}
512510
for _, flavor := range adapterRuntimeFlavors() {
513-
flavor := flavor
514511
t.Run(string(flavor), func(t *testing.T) {
515512
for _, tc := range cases {
516-
tc := tc
517513
t.Run(tc.name+"="+tc.value, func(t *testing.T) {
518514
args := []string{
519515
"--control-plane.tunnel-id", adapterTestTunnelID,
@@ -563,7 +559,6 @@ func TestFullAndRuntimeSharedProductionInputsParity(t *testing.T) {
563559
"HARPOON_PROXY": "http://harpoon-proxy.example.invalid:8080",
564560
})
565561
for _, flavor := range adapterRuntimeFlavors() {
566-
flavor := flavor
567562
t.Run(string(flavor), func(t *testing.T) {
568563
full, runtime := loadParityPairForFlavor(t, args, lookup, flavor)
569564
assertSharedRuntimeParity(t, full, runtime)
@@ -614,7 +609,6 @@ process:
614609
pid_file: relative/client.pid
615610
`)
616611
for _, flavor := range adapterRuntimeFlavors() {
617-
flavor := flavor
618612
t.Run(string(flavor), func(t *testing.T) {
619613
full, runtime := loadParityPairForFlavor(t, []string{"--config", profile}, lookupEnvMap(nil), flavor)
620614
assertSharedRuntimeParity(t, full, runtime)
@@ -635,7 +629,6 @@ func TestFullAndRuntimeFlavorsPreserveExactProfileBytes(t *testing.T) {
635629
lookup := lookupEnvMap(map[string]string{"CONTROL_PLANE_API_KEY": adapterTestAPIKey})
636630

637631
for _, flavor := range adapterRuntimeFlavors() {
638-
flavor := flavor
639632
t.Run(string(flavor), func(t *testing.T) {
640633
full, runtime := loadParityPairForFlavor(t, []string{"--config", profile}, lookup, flavor)
641634
assertSharedRuntimeParity(t, full, runtime)
@@ -854,15 +847,13 @@ func TestFullAndRuntimeFlavorsSharedEnvironmentParity(t *testing.T) {
854847

855848
covered := make(map[string]struct{})
856849
for _, tc := range cases {
857-
tc := tc
858850
for name := range tc.env {
859851
if adapterSharedEnvironmentName(name) {
860852
covered[name] = struct{}{}
861853
}
862854
}
863855
t.Run(tc.name, func(t *testing.T) {
864856
for _, flavor := range adapterRuntimeFlavors() {
865-
flavor := flavor
866857
t.Run(string(flavor), func(t *testing.T) {
867858
full, runtime := loadParityPairForFlavor(t, nil, lookupEnvMap(tc.env), flavor)
868859
assertSharedRuntimeParity(t, full, runtime)
@@ -904,7 +895,6 @@ func TestFullAndRuntimeStandardProxyEnvironmentDetectionParity(t *testing.T) {
904895

905896
covered := make(map[string]struct{}, len(adapterStandardProxyEnvironmentVariables))
906897
for _, testCase := range testCases {
907-
testCase := testCase
908898
for name := range testCase.env {
909899
if adapterStandardProxyEnvironmentName(name) {
910900
covered[name] = struct{}{}
@@ -978,7 +968,6 @@ proxy:
978968
args := []string{"--config", profile}
979969
lookup := lookupEnvMap(map[string]string{"CONTROL_PLANE_API_KEY": adapterTestAPIKey})
980970
for _, flavor := range adapterRuntimeFlavors() {
981-
flavor := flavor
982971
t.Run(string(flavor), func(t *testing.T) {
983972
full, runtime := loadParityPairForFlavor(t, args, lookup, flavor)
984973
assertSharedRuntimeParity(t, full, runtime)

pkg/runtimeconfig/shared_config_test.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1279,7 +1279,6 @@ func TestLoadMCPStartupWaitTimeout(t *testing.T) {
12791279
}
12801280

12811281
for _, testCase := range testCases {
1282-
testCase := testCase
12831282
t.Run(testCase.name, func(t *testing.T) {
12841283
t.Parallel()
12851284
args := append([]string{
@@ -1335,7 +1334,6 @@ func TestLoadMCPStdioSendInitializedNotification(t *testing.T) {
13351334
}
13361335

13371336
for _, testCase := range testCases {
1338-
testCase := testCase
13391337
t.Run(testCase.name, func(t *testing.T) {
13401338
t.Parallel()
13411339
args := append([]string{
@@ -2424,8 +2422,6 @@ func TestLoadValidatesTunnelIDFormat(t *testing.T) {
24242422
}
24252423

24262424
for name, tunnelID := range testCases {
2427-
name := name
2428-
tunnelID := tunnelID
24292425
t.Run(name, func(t *testing.T) {
24302426
t.Parallel()
24312427
_, err := LoadRuntimeForTest([]string{"--control-plane.tunnel-id", tunnelID}, func(key string) (string, bool) {
@@ -2566,7 +2562,6 @@ func TestParseHeader(t *testing.T) {
25662562
}
25672563

25682564
for _, tc := range tests {
2569-
tc := tc
25702565
t.Run(tc.input, func(t *testing.T) {
25712566
t.Parallel()
25722567
key, val, err := parseHeader(tc.input)
@@ -2593,7 +2588,6 @@ func TestParseHeaderRejectsInvalid(t *testing.T) {
25932588
{name: "missing value", input: "Missing-value: "},
25942589
{name: "line break", input: "X-Auth: secret-value\ncontinuation", doNotExpose: "secret-value"},
25952590
} {
2596-
tc := tc
25972591
t.Run(tc.name, func(t *testing.T) {
25982592
t.Parallel()
25992593
_, _, err := parseHeader(tc.input)
@@ -2713,7 +2707,6 @@ func TestBuildControlPlaneExtraHeadersRejectsReservedHeaders(t *testing.T) {
27132707
}
27142708

27152709
for _, tc := range testCases {
2716-
tc := tc
27172710
t.Run(tc.name, func(t *testing.T) {
27182711
t.Parallel()
27192712

@@ -2877,7 +2870,6 @@ func TestValidateFileConfigSyntaxRejectsReservedControlPlaneExtraHeaders(t *test
28772870
t.Parallel()
28782871

28792872
for _, header := range []string{"Authorization", "x-tunnel-mcp-server-info"} {
2880-
header := header
28812873
t.Run(header, func(t *testing.T) {
28822874
t.Parallel()
28832875

0 commit comments

Comments
 (0)