Skip to content

Commit 7f1f513

Browse files
scotwellsclaude
andcommitted
test(extension-server): drop opaque internal tags from comments
Replace "GAP-1b"/"design §" references with plain descriptions of what each assertion guards. The comments already explain the behavior; the tags added nothing for a future reader. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 467ee9d commit 7f1f513

1 file changed

Lines changed: 11 additions & 10 deletions

File tree

internal/extensionserver/server/server_test.go

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ func mkListenerWithStaticRoute(t *testing.T, name string) *listenerv3.Listener {
122122
}
123123

124124
// egGatewayMeta builds the envoy-gateway filter_metadata struct for a VH.
125-
// This simulates the metadata EG populates on VirtualHosts per design §2.1.
125+
// This simulates the metadata EG populates on VirtualHosts.
126126
func egGatewayMeta(t *testing.T, dsNS, gwName string) *corev3.Metadata {
127127
t.Helper()
128128
s, err := structpb.NewStruct(map[string]any{
@@ -547,8 +547,9 @@ func TestPostTranslateModify_EGInternalListener_Skipped(t *testing.T) {
547547
}
548548
}
549549

550-
// TestPostTranslateModify_TwoClusterTopology_DistinctReplicaUID is the GAP-1b
551-
// full-pipeline regression test. It simulates the two-cluster edge topology:
550+
// TestPostTranslateModify_TwoClusterTopology_DistinctReplicaUID is the
551+
// full-pipeline regression test for connector/TPP resolution in the two-cluster
552+
// edge topology:
552553
// - Ext-server client lists EDGE cluster replica namespaces.
553554
// - Replica namespace is named "ns-<upstream-uid>" but has a DISTINCT own UID
554555
// assigned by the edge cluster's API server.
@@ -704,15 +705,15 @@ func TestPostTranslateModify_TwoClusterTopology_DistinctReplicaUID(t *testing.T)
704705
require.NoError(t, err)
705706
require.NotNil(t, resp)
706707

707-
// --- Connector cluster must be replaced (GAP-1b: Connector resolution) ---
708+
// --- Connector cluster must be replaced (connector resolution) ---
708709
// Old code: DStoUS["ns-upstream-uid-abc"] absent → ReplaceConnectorClusters
709710
// skipped the cluster → no internal-upstream replacement.
710711
require.Len(t, resp.Clusters, 2)
711712
connectorCluster := resp.Clusters[0]
712713
assert.Equal(t, connCluster, connectorCluster.GetName(),
713714
"connector cluster name must be preserved")
714715
require.NotNil(t, connectorCluster.GetTransportSocket(),
715-
"GAP-1b regression: connector cluster must be replaced with internal-upstream; "+
716+
"connector cluster must be replaced with internal-upstream; "+
716717
"old code skipped it because DStoUS[replicaNSName] was absent")
717718
assert.Equal(t, "envoy.transport_sockets.internal_upstream",
718719
connectorCluster.GetTransportSocket().GetName())
@@ -721,12 +722,12 @@ func TestPostTranslateModify_TwoClusterTopology_DistinctReplicaUID(t *testing.T)
721722
assert.Nil(t, resp.Clusters[1].GetTransportSocket(),
722723
"non-connector cluster must not get transport_socket")
723724

724-
// --- Route must carry WAF config (GAP-1b: TPP resolution) ---
725+
// --- Route must carry WAF config (TPP resolution) ---
725726
// Old code: DStoUS["ns-upstream-uid-abc"] absent → ApplyTPPRouteConfig skipped
726727
// every VH → no WAF mutations → routes_tpp_applied:0.
727728
vh := resp.Routes[0].VirtualHosts[0]
728729
require.Len(t, vh.Routes, 2,
729-
"GAP-1b regression: CONNECT route must be prepended (connector was resolved); "+
730+
"CONNECT route must be prepended (connector was resolved); "+
730731
"old code left only the original forwarding route")
731732

732733
// CONNECT route first.
@@ -737,7 +738,7 @@ func TestPostTranslateModify_TwoClusterTopology_DistinctReplicaUID(t *testing.T)
737738
fwd := vh.Routes[1]
738739
tpfc := fwd.GetTypedPerFilterConfig()["coraza-waf"]
739740
require.NotNil(t, tpfc,
740-
"GAP-1b regression: forwarding route must have coraza typed_per_filter_config; "+
741+
"forwarding route must have coraza typed_per_filter_config; "+
741742
"old code silently skipped WAF injection")
742743
assert.True(t, strings.Contains(tpfc.GetTypeUrl(), "golang.v3alpha.ConfigsPerRoute"),
743744
"tpfc type url must reference ConfigsPerRoute")
@@ -754,10 +755,10 @@ func TestPostTranslateModify_TwoClusterTopology_DistinctReplicaUID(t *testing.T)
754755
assert.Equal(t, replicaNSName, entry["namespace"].GetStringValue())
755756

756757
// --- Connector resolved: its synthetic domain is appended ---
757-
// GAP-1b regression: old code never appended any domain because the
758+
// old code never appended any domain because the
758759
// connector was not resolved through the DStoUS mapping.
759760
assert.Contains(t, vh.Domains, "vh.connector.internal",
760-
"GAP-1b regression: connector must resolve and append its synthetic domain")
761+
"connector must resolve and append its synthetic domain")
761762
}
762763

763764
// TestPostTranslateModify_OfflineConnector_503Route verifies that an offline

0 commit comments

Comments
 (0)