Skip to content

Commit

Permalink
fix ci env
Browse files Browse the repository at this point in the history
  • Loading branch information
bzp2010 committed Dec 5, 2023
1 parent 11d35ed commit bbb2fc1
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions t/APISIX.pm
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,11 @@ _EOC_
require "resty.core"
local events_sock_path = "$apisix_home/t/servroot/logs/stream_worker_events.sock"
if os.getenv("TEST_NGINX_USE_HUP") ~= "1" and require("pl.path").exists(events_sock_path) then
os.remove(events_sock_path)
end
$stream_extra_init_by_lua_start
apisix = require("apisix")
Expand All @@ -437,6 +442,14 @@ _EOC_
$extra_stream_config
server {
listen unix:$apisix_home/t/servroot/logs/stream_worker_events.sock;
access_log off;
content_by_lua_block {
require("resty.events.compat").run()
}
}
# fake server, only for test
server {
listen 1995;
Expand Down Expand Up @@ -516,6 +529,11 @@ _EOC_
require "resty.core"
local events_sock_path = "$apisix_home/t/servroot/logs/worker_events.sock"
if os.getenv("TEST_NGINX_USE_HUP") ~= "1" and require("pl.path").exists(events_sock_path) then
os.remove(events_sock_path)
end
$extra_init_by_lua_start
apisix = require("apisix")
Expand Down Expand Up @@ -687,6 +705,18 @@ _EOC_
}
}
_EOC_

$http_config .= <<_EOC_;
server {
listen unix:$apisix_home/t/servroot/logs/worker_events.sock;
access_log off;
location / {
content_by_lua_block {
require("resty.events.compat").run()
}
}
}
_EOC_

$block->set_value("http_config", $http_config);
Expand Down

0 comments on commit bbb2fc1

Please sign in to comment.