Skip to content

Commit

Permalink
tests(*) make the host and port of grpcbin configurable (#8625)
Browse files Browse the repository at this point in the history
  • Loading branch information
ADD-SP committed May 18, 2022
1 parent 9da3dee commit 6a0a579
Show file tree
Hide file tree
Showing 30 changed files with 282 additions and 267 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ jobs:
KONG_TEST_PG_DATABASE: kong
KONG_TEST_PG_USER: kong
KONG_TEST_DATABASE: postgres
KONG_SPEC_TEST_GRPCBIN_PORT: "15002"
KONG_SPEC_TEST_GRPCBIN_SSL_PORT: "15003"
TEST_SUITE: ${{ matrix.suite }}
TEST_SPLIT: ${{ matrix.split }}

Expand Down Expand Up @@ -214,6 +216,8 @@ jobs:
KONG_TEST_PG_DATABASE: kong
KONG_TEST_PG_USER: kong
KONG_TEST_DATABASE: 'off'
KONG_SPEC_TEST_GRPCBIN_PORT: "15002"
KONG_SPEC_TEST_GRPCBIN_SSL_PORT: "15003"
TEST_SUITE: dbless

services:
Expand Down Expand Up @@ -267,6 +271,8 @@ jobs:

env:
KONG_TEST_DATABASE: cassandra
KONG_SPEC_TEST_GRPCBIN_PORT: "15002"
KONG_SPEC_TEST_GRPCBIN_SSL_PORT: "15003"
TEST_SUITE: ${{ matrix.suite }}
TEST_SPLIT: ${{ matrix.split }}

Expand Down
6 changes: 3 additions & 3 deletions spec/02-integration/05-proxy/02-router_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ for _, strategy in helpers.each_strategy() do
describe("use cases #grpc", function()
local routes
local service = {
url = "grpc://localhost:15002"
url = helpers.grpcbin_url,
}

local proxy_client_grpc
Expand Down Expand Up @@ -1742,15 +1742,15 @@ for _, strategy in helpers.each_strategy() do
snis = { "grpcs_1.test" },
service = {
name = "grpcs_1",
url = "grpcs://localhost:15003",
url = helpers.grpcbin_ssl_url,
},
},
{
protocols = { "grpcs" },
snis = { "grpcs_2.test" },
service = {
name = "grpcs_2",
url = "grpcs://localhost:15003",
url = helpers.grpcbin_ssl_url,
},
},
})
Expand Down
4 changes: 2 additions & 2 deletions spec/02-integration/05-proxy/19-grpc_proxy_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ for _, strategy in helpers.each_strategy() do

local service1 = assert(bp.services:insert {
name = "grpc",
url = "grpc://localhost:15002",
url = helpers.grpcbin_url,
})

local service2 = assert(bp.services:insert {
name = "grpcs",
url = "grpcs://localhost:15003",
url = helpers.grpcbin_ssl_url,
})

local mock_grpc_service = assert(bp.services:insert {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,12 @@ for _, strategy in helpers.each_strategy() do

local service1 = assert(bp.services:insert {
name = "grpc",
url = "grpc://localhost:15002",
url = helpers.grpcbin_url,
})

local service2 = assert(bp.services:insert {
name = "grpcs",
url = "grpcs://localhost:15003",
url = helpers.grpcbin_ssl_url,
})

assert(bp.routes:insert {
Expand Down
4 changes: 2 additions & 2 deletions spec/02-integration/05-proxy/22-reports_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ for _, strategy in helpers.each_strategy() do

local grpc_srv = bp.services:insert({
name = "grpc",
url = "grpc://localhost:15002",
url = helpers.grpcbin_url,
})

bp.routes:insert({
Expand All @@ -94,7 +94,7 @@ for _, strategy in helpers.each_strategy() do

local grpcs_srv = bp.services:insert({
name = "grpcs",
url = "grpcs://localhost:15003",
url = helpers.grpcbin_ssl_url,
})

bp.routes:insert({
Expand Down
4 changes: 2 additions & 2 deletions spec/03-plugins/01-tcp-log/01-tcp-log_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ for _, strategy in helpers.each_strategy() do

local grpc_service = assert(bp.services:insert {
name = "grpc-service",
url = "grpc://localhost:15002",
url = helpers.grpcbin_url,
})

local route3 = assert(bp.routes:insert {
Expand All @@ -80,7 +80,7 @@ for _, strategy in helpers.each_strategy() do

local grpcs_service = assert(bp.services:insert {
name = "grpcs-service",
url = "grpcs://localhost:15003",
url = helpers.grpcbin_ssl_url,
})

local route4 = assert(bp.routes:insert {
Expand Down
4 changes: 2 additions & 2 deletions spec/03-plugins/02-udp-log/01-udp-log_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ for _, strategy in helpers.each_strategy() do

local grpc_service = assert(bp.services:insert {
name = "grpc-service",
url = "grpc://localhost:15002",
url = helpers.grpcbin_url,
})

local route2 = assert(bp.routes:insert {
Expand All @@ -69,7 +69,7 @@ for _, strategy in helpers.each_strategy() do

local grpcs_service = assert(bp.services:insert {
name = "grpcs-service",
url = "grpcs://localhost:15003",
url = helpers.grpcbin_ssl_url,
})

local route3 = assert(bp.routes:insert {
Expand Down
4 changes: 2 additions & 2 deletions spec/03-plugins/03-http-log/01-log_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ for _, strategy in helpers.each_strategy() do

local grpc_service = assert(bp.services:insert {
name = "grpc-service",
url = "grpc://localhost:15002",
url = helpers.grpcbin_url,
})

local route7 = assert(bp.routes:insert {
Expand All @@ -167,7 +167,7 @@ for _, strategy in helpers.each_strategy() do

local grpcs_service = assert(bp.services:insert {
name = "grpcs-service",
url = "grpcs://localhost:15003",
url = helpers.grpcbin_ssl_url,
})

local route8 = assert(bp.routes:insert {
Expand Down
4 changes: 2 additions & 2 deletions spec/03-plugins/04-file-log/01-log_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ for _, strategy in helpers.each_strategy() do

local grpc_service = assert(bp.services:insert {
name = "grpc-service",
url = "grpc://localhost:15002",
url = helpers.grpcbin_url,
})

local route2 = assert(bp.routes:insert {
Expand All @@ -56,7 +56,7 @@ for _, strategy in helpers.each_strategy() do

local grpcs_service = assert(bp.services:insert {
name = "grpcs-service",
url = "grpcs://localhost:15003",
url = helpers.grpcbin_ssl_url,
})

local route3 = assert(bp.routes:insert {
Expand Down
2 changes: 1 addition & 1 deletion spec/03-plugins/05-syslog/01-log_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ for _, strategy in helpers.each_strategy() do
-- grpc [[
local grpc_service = bp.services:insert {
name = "grpc-service",
url = "grpc://localhost:15002",
url = helpers.grpcbin_url,
}

local grpc_route1 = bp.routes:insert {
Expand Down
2 changes: 1 addition & 1 deletion spec/03-plugins/06-statsd/01-log_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ for _, strategy in helpers.each_strategy() do
local grpc_routes = {}
for i = 1, 2 do
local service = bp.services:insert {
url = "grpc://localhost:15002",
url = helpers.grpcbin_url,
name = fmt("grpc_statsd%s", i)
}
grpc_routes[i] = bp.routes:insert {
Expand Down
2 changes: 1 addition & 1 deletion spec/03-plugins/07-loggly/01-log_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ for _, strategy in helpers.each_strategy() do
-- grpc [[
local grpc_service = bp.services:insert {
name = "grpc-service",
url = "grpc://localhost:15002",
url = helpers.grpcbin_url,
}

local grpc_route1 = bp.routes:insert {
Expand Down
2 changes: 1 addition & 1 deletion spec/03-plugins/08-datadog/01-log_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ for _, strategy in helpers.each_strategy() do
paths = { "/hello.HelloService/" },
service = assert(bp.services:insert {
name = "grpc",
url = "grpc://localhost:15002",
url = helpers.grpcbin_url,
}),
})

Expand Down
2 changes: 1 addition & 1 deletion spec/03-plugins/09-key-auth/02-access_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ for _, strategy in helpers.each_strategy() do
paths = { "/hello.HelloService/" },
service = assert(bp.services:insert {
name = "grpc",
url = "grpc://localhost:15002",
url = helpers.grpcbin_url,
}),
})

Expand Down
2 changes: 1 addition & 1 deletion spec/03-plugins/10-basic-auth/03-access_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ for _, strategy in helpers.each_strategy() do
paths = { "/hello.HelloService/" },
service = assert(bp.services:insert {
name = "grpc",
url = "grpc://localhost:15002",
url = helpers.grpcbin_url,
}),
})

Expand Down
2 changes: 1 addition & 1 deletion spec/03-plugins/11-correlation-id/01-access_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ for _, strategy in helpers.each_strategy() do
paths = { "/hello.HelloService/" },
service = assert(bp.services:insert {
name = "grpc",
url = "grpc://localhost:15002",
url = helpers.grpcbin_url,
}),
})

Expand Down
2 changes: 1 addition & 1 deletion spec/03-plugins/14-request-termination/02-access_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ for _, strategy in helpers.each_strategy() do
paths = { "/hello.HelloService/" },
service = assert(bp.services:insert {
name = "grpc",
url = "grpc://localhost:15002",
url = helpers.grpcbin_url,
}),
})

Expand Down
2 changes: 1 addition & 1 deletion spec/03-plugins/16-jwt/03-access_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ for _, strategy in helpers.each_strategy() do
paths = { "/hello.HelloService/" },
service = assert(bp.services:insert {
name = "grpc",
url = "grpc://localhost:15002",
url = helpers.grpcbin_url,
}),
})

Expand Down
2 changes: 1 addition & 1 deletion spec/03-plugins/17-ip-restriction/02-access_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ for _, strategy in helpers.each_strategy() do

local grpc_service = bp.services:insert {
name = "grpc1",
url = "grpc://localhost:15002",
url = helpers.grpcbin_url,
}

local route_grpc_deny = assert(bp.routes:insert {
Expand Down
2 changes: 1 addition & 1 deletion spec/03-plugins/19-hmac-auth/03-access_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ for _, strategy in helpers.each_strategy() do
paths = { "/hello.HelloService/" },
service = assert(bp.services:insert {
name = "grpc",
url = "grpc://localhost:15002",
url = helpers.grpcbin_url,
}),
})

Expand Down
2 changes: 1 addition & 1 deletion spec/03-plugins/20-ldap-auth/01-access_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ for _, ldap_strategy in pairs(ldap_strategies) do
paths = { "/hello.HelloService/" },
service = assert(bp.services:insert {
name = "grpc",
url = "grpc://localhost:15002",
url = helpers.grpcbin_url,
}),
})

Expand Down
2 changes: 1 addition & 1 deletion spec/03-plugins/21-bot-detection/01-access_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ for _, strategy in helpers.each_strategy() do

local grpc_service = bp.services:insert {
name = "grpc1",
url = "grpc://localhost:15002",
url = helpers.grpcbin_url,
}

local route_grpc1 = assert(bp.routes:insert {
Expand Down
Loading

0 comments on commit 6a0a579

Please sign in to comment.