Copilot commented on code in PR #2614:
URL:
https://github.com/apache/apisix-ingress-controller/pull/2614#discussion_r2458524402
##########
internal/adc/translator/annotations_test.go:
##########
@@ -77,11 +81,94 @@ func TestTranslateAnnotations(t *testing.T) {
assert.NoError(t, err)
}
assert.Equal(t, tt.expected, dst)
+ })
+ }
+}
- // Clean up mock parsers
- for key := range tt.parsers {
- delete(ingressAnnotationParsers, key)
- }
+func TestTranslateIngressAnnotations(t *testing.T) {
+ tests := []struct {
+ name string
+ anno map[string]string
+ expected *IngressConfig
+ }{
+ {
+ name: "no matching annotations",
+ anno: map[string]string{"upstream": "value1"},
+ expected: &IngressConfig{},
+ },
+ {
+ name: "invalid scheme",
+ anno:
map[string]string{annotations.AnnotationsUpstreamScheme: "invalid"},
+ expected: &IngressConfig{},
+ },
+ {
+ name: "http scheme",
+ anno:
map[string]string{annotations.AnnotationsUpstreamScheme: "https"},
+ expected: &IngressConfig{
+ Upstream: upstream.Upstream{
+ Scheme: "https",
+ },
+ },
+ },
+ {
+ name: "retrics",
Review Comment:
Corrected spelling of 'retrics' to 'retries'.
```suggestion
name: "retries",
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]