Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

conformance: add support for GRPCRoute #5776

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

tao12345666333
Copy link
Member

@tao12345666333 tao12345666333 commented Mar 28, 2024

What this PR does / why we need it:

Which issue this PR fixes:

fixes: #5705

Special notes for your reviewer:

PR Readiness Checklist:

Complete these before marking the PR as ready to review:

  • the CHANGELOG.md release notes have been updated to reflect any significant (and particularly user-facing) changes introduced by this PR

@tao12345666333 tao12345666333 added the kind/conformance Conformance to upstream Kubernetes SIG Networking Gateway API label Mar 28, 2024
@tao12345666333
Copy link
Member Author

tao12345666333 commented Mar 28, 2024

  --- FAIL: TestGatewayConformance/GRPCExactMethodMatching (0.07s)
        --- PASS: TestGatewayConformance/GRPCExactMethodMatching/2_request_to_'/gateway_api_conformance.echo_basic.grpcecho.GrpcEcho/EchoThree'_should_receive_a_Unimplemented_(12) (0.01s)
        --- FAIL: TestGatewayConformance/GRPCExactMethodMatching/0_request_to_'/gateway_api_conformance.echo_basic.grpcecho.GrpcEcho/Echo'_should_go_to_grpc-infra-backend-v1 (30.00s)
        --- FAIL: TestGatewayConformance/GRPCExactMethodMatching/1_request_to_'/gateway_api_conformance.echo_basic.grpcecho.GrpcEcho/EchoTwo'_should_go_to_grpc-infra-backend-v2 (30.00s)
    --- FAIL: TestGatewayConformance/GRPCRouteHeaderMatching (0.06s)
        --- FAIL: TestGatewayConformance/GRPCRouteHeaderMatching/1_request_to_'/gateway_api_conformance.echo_basic.grpcecho.GrpcEcho/Echo'_with_headers_'{Version:two}'_should_go_to_grpc-infra-backend-v2 (30.00s)
        --- FAIL: TestGatewayConformance/GRPCRouteHeaderMatching/7_request_to_'/gateway_api_conformance.echo_basic.grpcecho.GrpcEcho/Echo'_with_headers_'{Color:green}'_should_go_to_grpc-infra-backend-v1 (30.00s)
        --- FAIL: TestGatewayConformance/GRPCRouteHeaderMatching/8_request_to_'/gateway_api_conformance.echo_basic.grpcecho.GrpcEcho/Echo'_with_headers_'{Color:red}'_should_go_to_grpc-infra-backend-v2 (30.00s)
        --- FAIL: TestGatewayConformance/GRPCRouteHeaderMatching/9_request_to_'/gateway_api_conformance.echo_basic.grpcecho.GrpcEcho/Echo'_with_headers_'{Color:yellow}'_should_go_to_grpc-infra-backend-v2 (30.00s)
        --- PASS: TestGatewayConformance/GRPCRouteHeaderMatching/10_request_to_'/gateway_api_conformance.echo_basic.grpcecho.GrpcEcho/Echo'_with_headers_'{Color:purple}'_should_receive_a_Unimplemented_(12) (0.01s)
        --- PASS: TestGatewayConformance/GRPCRouteHeaderMatching/4_request_to_'/gateway_api_conformance.echo_basic.grpcecho.GrpcEcho/Echo'_with_headers_'{Color:orange}'_should_receive_a_Unimplemented_(12) (0.00s)
        --- FAIL: TestGatewayConformance/GRPCRouteHeaderMatching/6_request_to_'/gateway_api_conformance.echo_basic.grpcecho.GrpcEcho/Echo'_with_headers_'{Color:blue}'_should_go_to_grpc-infra-backend-v1 (30.00s)
        --- FAIL: TestGatewayConformance/GRPCRouteHeaderMatching/3_request_to_'/gateway_api_conformance.echo_basic.grpcecho.GrpcEcho/Echo'_with_headers_'{Color:blue,Version:two}'_should_go_to_grpc-infra-backend-v2 (30.00s)
        --- PASS: TestGatewayConformance/GRPCRouteHeaderMatching/5_request_to_'/gateway_api_conformance.echo_basic.grpcecho.GrpcEcho/Echo'_with_headers_'{Some-Other-Header:one}'_should_receive_a_Unimplemented_(12) (0.00s)
        --- FAIL: TestGatewayConformance/GRPCRouteHeaderMatching/2_request_to_'/gateway_api_conformance.echo_basic.grpcecho.GrpcEcho/Echo'_with_headers_'{Color:orange,Version:two}'_should_go_to_grpc-infra-backend-v1 (30.00s)
        --- FAIL: TestGatewayConformance/GRPCRouteHeaderMatching/0_request_to_'/gateway_api_conformance.echo_basic.grpcecho.GrpcEcho/Echo'_with_headers_'{Version:one}'_should_go_to_grpc-infra-backend-v1 (30.00s)
    --- FAIL: TestGatewayConformance/GRPCRouteListenerHostnameMatching (1.29s)
        --- FAIL: TestGatewayConformance/GRPCRouteListenerHostnameMatching/1_request_to_'foo.bar.com/gateway_api_conformance.echo_basic.grpcecho.GrpcEcho/Echo'_should_go_to_grpc-infra-backend-v2 (30.00s)
        --- FAIL: TestGatewayConformance/GRPCRouteListenerHostnameMatching/3_request_to_'boo.bar.com/gateway_api_conformance.echo_basic.grpcecho.GrpcEcho/Echo'_should_go_to_grpc-infra-backend-v3 (30.00s)
        --- FAIL: TestGatewayConformance/GRPCRouteListenerHostnameMatching/7_request_to_'no.matching.host/gateway_api_conformance.echo_basic.grpcecho.GrpcEcho/Echo'_should_receive_a_Unimplemented_(12) (30.00s)
        --- FAIL: TestGatewayConformance/GRPCRouteListenerHostnameMatching/5_request_to_'multiple.prefixes.foo.com/gateway_api_conformance.echo_basic.grpcecho.GrpcEcho/Echo'_should_go_to_grpc-infra-backend-v3 (30.00s)
        --- FAIL: TestGatewayConformance/GRPCRouteListenerHostnameMatching/6_request_to_'foo.com/gateway_api_conformance.echo_basic.grpcecho.GrpcEcho/Echo'_should_receive_a_Unimplemented_(12) (30.00s)
        --- FAIL: TestGatewayConformance/GRPCRouteListenerHostnameMatching/4_request_to_'multiple.prefixes.bar.com/gateway_api_conformance.echo_basic.grpcecho.GrpcEcho/Echo'_should_go_to_grpc-infra-backend-v3 (30.00s)
        --- FAIL: TestGatewayConformance/GRPCRouteListenerHostnameMatching/0_request_to_'bar.com/gateway_api_conformance.echo_basic.grpcecho.GrpcEcho/Echo'_should_go_to_grpc-infra-backend-v1 (30.00s)
        --- FAIL: TestGatewayConformance/GRPCRouteListenerHostnameMatching/2_request_to_'baz.bar.com/gateway_api_conformance.echo_basic.grpcecho.GrpcEcho/Echo'_should_go_to_grpc-infra-backend-v3 (30.00s)

most of these tests have failed.

Copy link

codecov bot commented Mar 28, 2024

Codecov Report

Attention: Patch coverage is 33.33333% with 8 lines in your changes are missing coverage. Please review.

Please upload report for BASE (main@26c26ed). Learn more about missing BASE report.

Current head 1c6a1cb differs from pull request most recent head 8cd6b9b

Please upload reports for the commit 8cd6b9b to get more accurate results.

Files Patch % Lines
...nternal/controllers/gateway/route_parent_status.go 0.0% 5 Missing ⚠️
...ternal/dataplane/translator/translate_grpcroute.go 66.6% 1 Missing and 1 partial ⚠️
...ternal/controllers/gateway/grpcroute_controller.go 0.0% 1 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff           @@
##             main   #5776   +/-   ##
======================================
  Coverage        ?   73.6%           
======================================
  Files           ?     193           
  Lines           ?   18814           
  Branches        ?       0           
======================================
  Hits            ?   13848           
  Misses          ?    4005           
  Partials        ?     961           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tao12345666333
Copy link
Member Author

Blocked by #5918

Signed-off-by: Jintao Zhang <zhangjintao9020@gmail.com>
Signed-off-by: Jintao Zhang <zhangjintao9020@gmail.com>
@tao12345666333
Copy link
Member Author

For TEST_KONG_ROUTER_FLAVOR=traditional_compatible make test.conformance, there is a failed case here.

        --- FAIL: TestGatewayConformance/GRPCRouteHeaderMatching/3_request_to_'/gateway_api_conformance.echo_basic.grpcecho.GrpcEcho/Echo'_with_headers_'{Color:blue,Version:two}'_should_go_to_grpc-infra-backend-v2 (30.00s)

Signed-off-by: Jintao Zhang <zhangjintao9020@gmail.com>
Signed-off-by: Jintao Zhang <zhangjintao9020@gmail.com>
@tao12345666333 tao12345666333 marked this pull request as ready for review May 19, 2024 00:07
@tao12345666333 tao12345666333 requested a review from a team as a code owner May 19, 2024 00:07
Copy link
Contributor

@randmonkey randmonkey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost LGTM. some minor comments

@@ -82,6 +82,10 @@ func TestMain(m *testing.M) {
kongBuilder = kongBuilder.WithProxyEnvVar("router_flavor", string(dpconf.RouterFlavorExpressions))
}

// The test cases for GRPCRoute in the current GatewayAPI all use the h2c protocol.
// In order to pass conformance tests, the proxy must listen http2 and http on the same port.
kongBuilder.WithProxyEnvVar("PROXY_LISTEN", `0.0.0.0:8000 http2\, 0.0.0.0:8443 http2 ssl`)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any reason to add a \ to escape the ,?

@@ -24,7 +24,8 @@ const (
// GRPCBinImage is the container image name we use for deploying the "grpcbin" GRPC testing tool.
// See: https://github.com/Kong/grpcbin
GRPCBinImage = "kong/grpcbin:latest"
GRPCBinPort = 9001
GRPCBinPort = 9000
GRPCSBinPort = 9001
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This GRPCSBinPort seems not be refefenced anywhere now. Also, in test/integration/isolated/ingress_test.go, the test/consts package is imported but it did not use the constants for defining ports for grpc services.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/conformance Conformance to upstream Kubernetes SIG Networking Gateway API size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GRPCRoute conformance
2 participants