Skip to content

Commit

Permalink
tests(helpers): reorganize grpc target service
Browse files Browse the repository at this point in the history
  • Loading branch information
gszr committed Jan 22, 2025
1 parent 78c6923 commit cd9ac02
Show file tree
Hide file tree
Showing 29 changed files with 428 additions and 276 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:

- name: Install packages
if: steps.cache-deps.outputs.cache-hit != 'true'
run: sudo apt update && sudo apt install libyaml-dev valgrind libprotobuf-dev
run: sudo apt update && sudo apt install libyaml-dev valgrind libprotobuf-dev protobuf-compiler

- name: Build Kong
if: steps.cache-deps.outputs.cache-hit != 'true'
Expand Down
4 changes: 2 additions & 2 deletions spec/03-plugins/28-grpc-gateway/01-proxy_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ for _, strategy in helpers.each_strategy() do
route = route1,
name = "grpc-gateway",
config = {
proto = "./spec/fixtures/grpc/targetservice.proto",
proto = "./spec/fixtures/grpc/proto/targetservice.proto",
},
})

Expand All @@ -64,7 +64,7 @@ for _, strategy in helpers.each_strategy() do
route = mock_grpc_route,
name = "grpc-gateway",
config = {
proto = "./spec/fixtures/grpc/targetservice.proto",
proto = "./spec/fixtures/grpc/proto/targetservice.proto",
},
})

Expand Down
1 change: 1 addition & 0 deletions spec/fixtures/grpc/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
target
18 changes: 18 additions & 0 deletions spec/fixtures/grpc/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module grpc

go 1.21

toolchain go1.22.10

require (
github.com/golang/protobuf v1.5.4
google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea
google.golang.org/grpc v1.65.1
google.golang.org/protobuf v1.34.1
)

require (
golang.org/x/net v0.25.0 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/text v0.15.0 // indirect
)
67 changes: 48 additions & 19 deletions spec/fixtures/grpc/target/go.sum → spec/fixtures/grpc/go.sum

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ service Bouncer {
body: "*"
};
}

rpc EchoHeaders(Void) returns (Headers) {
option (google.api.http) = {
get: "/v1/echoheaders"
};
}
}


Expand Down Expand Up @@ -93,3 +99,5 @@ message EchoMsg {
repeated string array = 1;
string nullable = 2;
}

message Void {}
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import (
"net"
"time"

pb "target/targetservice"
pb "grpc/targetservice"

"google.golang.org/grpc"
"google.golang.org/protobuf/types/known/timestamppb"
)

const (
port = ":15010"
port = "localhost:15010"
)

type server struct {
Expand Down
10 changes: 0 additions & 10 deletions spec/fixtures/grpc/target/go.mod

This file was deleted.

Loading

0 comments on commit cd9ac02

Please sign in to comment.