Skip to content

Commit c250198

Browse files
hb-chenpull[bot]
authored andcommitted
Fix query params for in-process local requests (grpc-ecosystem#1212)
* template query params bug * add test case for invoke in process gateway * fix bazel error
1 parent 088ddf3 commit c250198

File tree

10 files changed

+164
-32
lines changed

10 files changed

+164
-32
lines changed

examples/internal/integration/integration_test.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1660,13 +1660,19 @@ func testResponseStrings(t *testing.T, port int) {
16601660
}
16611661

16621662
func TestRequestQueryParams(t *testing.T) {
1663+
testRequestQueryParams(t, 8088)
1664+
}
1665+
1666+
func TestRequestQueryParamsInProcessGateway(t *testing.T) {
1667+
testRequestQueryParams(t, 8089)
1668+
}
1669+
1670+
func testRequestQueryParams(t *testing.T, port int) {
16631671
if testing.Short() {
16641672
t.Skip()
16651673
return
16661674
}
16671675

1668-
port := 8088
1669-
16701676
formValues := url.Values{}
16711677
formValues.Set("string_value", "hello-world")
16721678
formValues.Add("repeated_string_value", "demo1")

examples/internal/integration/main_test.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func waitForGateway(ctx context.Context, port uint16) error {
5757
}
5858

5959
func runServers(ctx context.Context) <-chan error {
60-
ch := make(chan error, 2)
60+
ch := make(chan error, 3)
6161
go func() {
6262
if err := server.Run(ctx, *network, *endpoint); err != nil {
6363
ch <- fmt.Errorf("cannot run grpc service: %v", err)
@@ -68,6 +68,11 @@ func runServers(ctx context.Context) <-chan error {
6868
ch <- fmt.Errorf("cannot run gateway service: %v", err)
6969
}
7070
}()
71+
go func() {
72+
if err := server.RunInProcessGateway(ctx, ":8089"); err != nil {
73+
ch <- fmt.Errorf("cannot run in process gateway service: %v", err)
74+
}
75+
}()
7176
return ch
7277
}
7378

examples/internal/proto/examplepb/a_bit_of_everything.pb.gw.go

Lines changed: 32 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/internal/proto/examplepb/echo_service.pb.gw.go

Lines changed: 24 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/internal/proto/examplepb/flow_combination.pb.gw.go

Lines changed: 32 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/internal/proto/examplepb/non_standard_names.pb.gw.go

Lines changed: 8 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/internal/proto/examplepb/unannotated_echo_service.pb.gw.go

Lines changed: 12 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/internal/server/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ go_library(
1919
"//examples/internal/proto/examplepb:go_default_library",
2020
"//examples/internal/proto/sub:go_default_library",
2121
"//examples/internal/proto/sub2:go_default_library",
22+
"//runtime:go_default_library",
2223
"@com_github_golang_glog//:go_default_library",
2324
"@com_github_golang_protobuf//proto:go_default_library",
2425
"@com_github_golang_protobuf//protoc-gen-go/generator:go_default_library_gen",

0 commit comments

Comments
 (0)