Skip to content

Commit

Permalink
Merge branch 'master' into next
Browse files Browse the repository at this point in the history
  • Loading branch information
hishamhm committed Aug 14, 2019
2 parents 3f37ade + 36e9b48 commit b9a6568
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 16 deletions.
6 changes: 1 addition & 5 deletions .ci/setup_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@
DEPS_HASH=$(cat .ci/setup_env.sh .travis.yml | md5sum | awk '{ print $1 }')
BUILD_TOOLS_DOWNLOAD=$DOWNLOAD_ROOT/openresty-build-tools

mkdir -p $BUILD_TOOLS_DOWNLOAD

wget -O $BUILD_TOOLS_DOWNLOAD/kong-ngx-build https://raw.githubusercontent.com/Kong/openresty-build-tools/master/kong-ngx-build
chmod +x $BUILD_TOOLS_DOWNLOAD/kong-ngx-build

git clone https://github.com/Kong/openresty-build-tools.git $DOWNLOAD_ROOT/openresty-build-tools
export PATH=$BUILD_TOOLS_DOWNLOAD:$PATH

#--------
Expand Down
8 changes: 4 additions & 4 deletions spec/02-integration/05-proxy/04-plugins_triggering_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -588,21 +588,21 @@ for _, strategy in helpers.each_strategy() do

do
-- service to mock HTTP 504
local httpbin_service = bp.services:insert {
local blackhole_service = bp.services:insert {
name = "timeout",
host = "httpbin.org",
host = helpers.blackhole_host,
connect_timeout = 1, -- ms
}

bp.routes:insert {
hosts = { "connect_timeout" },
protocols = { "http" },
service = httpbin_service,
service = blackhole_service,
}

bp.plugins:insert {
name = "file-log",
service = { id = httpbin_service.id },
service = { id = blackhole_service.id },
config = {
path = FILE_LOG_PATH,
reopen = true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ local poll_wait_health
local poll_wait_address_health
do
local function poll_wait(upstream_id, host, port, admin_port, fn)
local hard_timeout = ngx.now() + 70
local hard_timeout = ngx.now() + 70
while ngx.now() < hard_timeout do
local health = get_upstream_health(upstream_id, admin_port)
if health then
Expand All @@ -371,14 +371,14 @@ do

poll_wait_health = function(upstream_id, host, port, value, admin_port)
local ok = poll_wait(upstream_id, host, port, admin_port, function(d)
return d.health == value
return d.health == value
end)
if ok then
return true
end
assert(false, "timed out waiting for " .. host .. ":" .. port .. " in " ..
upstream_id .. " to become " .. value)
end
upstream_id .. " to become " .. value)
end

poll_wait_address_health = function(upstream_id, host, port, address_host, address_port, value)
local ok = poll_wait(upstream_id, host, port, nil, function(d)
Expand All @@ -394,7 +394,7 @@ do
return true
end
assert(false, "timed out waiting for " .. address_host .. ":" .. address_port .. " in " ..
upstream_id .. " to become " .. value)
upstream_id .. " to become " .. value)
end
end

Expand Down
4 changes: 2 additions & 2 deletions spec/02-integration/05-proxy/12-error_default_type_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ for _, strategy in helpers.each_strategy() do
local service = bp.services:insert {
name = "api-1",
protocol = "http",
host = "konghq.com",
host = helpers.blackhole_host,
port = 81,
connect_timeout = 1,
}
Expand Down Expand Up @@ -89,7 +89,7 @@ for _, strategy in helpers.each_strategy() do
local service = bp.services:insert {
name = "api-1",
protocol = "http",
host = "konghq.com",
host = helpers.blackhole_host,
port = 81,
connect_timeout = 1,
}
Expand Down
3 changes: 3 additions & 0 deletions spec/helpers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ local MOCK_UPSTREAM_SSL_PORT = 15556
local MOCK_UPSTREAM_STREAM_PORT = 15557
local MOCK_UPSTREAM_STREAM_SSL_PORT = 15558
local MOCK_GRPC_UPSTREAM_PROTO_PATH = "./spec/fixtures/grpc/hello.proto"
local BLACKHOLE_HOST = "10.255.255.255"

local consumers_schema_def = require "kong.db.schema.entities.consumers"
local services_schema_def = require "kong.db.schema.entities.services"
Expand Down Expand Up @@ -1842,6 +1843,8 @@ return {

redis_host = os.getenv("KONG_SPEC_REDIS_HOST") or "127.0.0.1",

blackhole_host = BLACKHOLE_HOST,

-- Kong testing helpers
execute = exec,
dns_mock = dns_mock,
Expand Down

0 comments on commit b9a6568

Please sign in to comment.