Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions pkg/test/cel/grpcroute_experimental_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func TestGRPCRequestMirrorFilterExperimental(t *testing.T) {
rules []gatewayv1.GRPCRouteRule
}{
{
name: "GRPCRoute - Invalid because both percent and fraction are specified",
name: "GRPCRoute - Invalid because both percent and fraction are specified",
wantErrors: []string{"Only one of percent or fraction may be specified in HTTPRequestMirrorFilter"},
rules: []gatewayv1.GRPCRouteRule{{
Filters: []gatewayv1.GRPCRouteFilter{{
Expand All @@ -67,15 +67,15 @@ func TestGRPCRequestMirrorFilterExperimental(t *testing.T) {
},
Percent: &percent,
Fraction: &gatewayv1.Fraction{
Numerator: 83,
Numerator: 83,
Denominator: &denominator,
},
},
}},
}},
},
{
name: "GRPCRoute - Invalid fraction - numerator greater than denominator",
name: "GRPCRoute - Invalid fraction - numerator greater than denominator",
wantErrors: []string{"numerator must be less than or equal to denominator"},
rules: []gatewayv1.GRPCRouteRule{{
Filters: []gatewayv1.GRPCRouteFilter{{
Expand All @@ -86,15 +86,15 @@ func TestGRPCRequestMirrorFilterExperimental(t *testing.T) {
Port: ptrTo(gatewayv1.PortNumber(8081)),
},
Fraction: &gatewayv1.Fraction{
Numerator: 1001,
Numerator: 1001,
Denominator: &denominator,
},
},
}},
}},
},
{
name: "GRPCRoute - Invalid fraction - denominator is 0",
name: "GRPCRoute - Invalid fraction - denominator is 0",
wantErrors: []string{"spec.rules[0].filters[0].requestMirror.fraction.denominator in body should be greater than or equal to 1"},
rules: []gatewayv1.GRPCRouteRule{{
Filters: []gatewayv1.GRPCRouteFilter{{
Expand All @@ -105,15 +105,15 @@ func TestGRPCRequestMirrorFilterExperimental(t *testing.T) {
Port: ptrTo(gatewayv1.PortNumber(8081)),
},
Fraction: &gatewayv1.Fraction{
Numerator: 0,
Numerator: 0,
Denominator: &bad_denominator,
},
},
}},
}},
},
{
name: "GRPCRoute - Invalid fraction - numerator is negative",
name: "GRPCRoute - Invalid fraction - numerator is negative",
wantErrors: []string{"spec.rules[0].filters[0].requestMirror.fraction.numerator in body should be greater than or equal to 0"},
rules: []gatewayv1.GRPCRouteRule{{
Filters: []gatewayv1.GRPCRouteFilter{{
Expand All @@ -124,7 +124,7 @@ func TestGRPCRequestMirrorFilterExperimental(t *testing.T) {
Port: ptrTo(gatewayv1.PortNumber(8081)),
},
Fraction: &gatewayv1.Fraction{
Numerator: -1,
Numerator: -1,
Denominator: &denominator,
},
},
Expand Down Expand Up @@ -157,7 +157,7 @@ func TestGRPCRequestMirrorFilterExperimental(t *testing.T) {
Port: ptrTo(gatewayv1.PortNumber(8081)),
},
Fraction: &gatewayv1.Fraction{
Numerator: 83,
Numerator: 83,
Denominator: &denominator,
},
},
Expand Down
18 changes: 9 additions & 9 deletions pkg/test/cel/httproute_experimental_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ func TestHTTPRequestMirrorFilterExperimental(t *testing.T) {
rules []gatewayv1.HTTPRouteRule
}{
{
name: "HTTPRoute - Invalid because both percent and fraction are specified",
name: "HTTPRoute - Invalid because both percent and fraction are specified",
wantErrors: []string{"Only one of percent or fraction may be specified in HTTPRequestMirrorFilter"},
rules: []gatewayv1.HTTPRouteRule{{
Filters: []gatewayv1.HTTPRouteFilter{{
Expand All @@ -456,15 +456,15 @@ func TestHTTPRequestMirrorFilterExperimental(t *testing.T) {
},
Percent: &percent,
Fraction: &gatewayv1.Fraction{
Numerator: 83,
Numerator: 83,
Denominator: &denominator,
},
},
}},
}},
},
{
name: "HTTPRoute - Invalid fraction - numerator greater than denominator",
name: "HTTPRoute - Invalid fraction - numerator greater than denominator",
wantErrors: []string{"numerator must be less than or equal to denominator"},
rules: []gatewayv1.HTTPRouteRule{{
Filters: []gatewayv1.HTTPRouteFilter{{
Expand All @@ -475,15 +475,15 @@ func TestHTTPRequestMirrorFilterExperimental(t *testing.T) {
Port: ptrTo(gatewayv1.PortNumber(8081)),
},
Fraction: &gatewayv1.Fraction{
Numerator: 1001,
Numerator: 1001,
Denominator: &denominator,
},
},
}},
}},
},
{
name: "HTTPRoute - Invalid fraction - denominator is 0",
name: "HTTPRoute - Invalid fraction - denominator is 0",
wantErrors: []string{"spec.rules[0].filters[0].requestMirror.fraction.denominator in body should be greater than or equal to 1"},
rules: []gatewayv1.HTTPRouteRule{{
Filters: []gatewayv1.HTTPRouteFilter{{
Expand All @@ -494,15 +494,15 @@ func TestHTTPRequestMirrorFilterExperimental(t *testing.T) {
Port: ptrTo(gatewayv1.PortNumber(8081)),
},
Fraction: &gatewayv1.Fraction{
Numerator: 0,
Numerator: 0,
Denominator: &bad_denominator,
},
},
}},
}},
},
{
name: "HTTPRoute - Invalid fraction - numerator is negative",
name: "HTTPRoute - Invalid fraction - numerator is negative",
wantErrors: []string{"spec.rules[0].filters[0].requestMirror.fraction.numerator in body should be greater than or equal to 0"},
rules: []gatewayv1.HTTPRouteRule{{
Filters: []gatewayv1.HTTPRouteFilter{{
Expand All @@ -513,7 +513,7 @@ func TestHTTPRequestMirrorFilterExperimental(t *testing.T) {
Port: ptrTo(gatewayv1.PortNumber(8081)),
},
Fraction: &gatewayv1.Fraction{
Numerator: -1,
Numerator: -1,
Denominator: &denominator,
},
},
Expand Down Expand Up @@ -546,7 +546,7 @@ func TestHTTPRequestMirrorFilterExperimental(t *testing.T) {
Port: ptrTo(gatewayv1.PortNumber(8081)),
},
Fraction: &gatewayv1.Fraction{
Numerator: 83,
Numerator: 83,
Denominator: &denominator,
},
},
Expand Down