Skip to content

Commit 82dc4cb

Browse files
spacewanderthibaultcha
authored andcommitted
tests: removed resty-cli from the test dependencies.
Signed-off-by: Thibault Charbonnier <thibaultcha@me.com>
1 parent fc141ce commit 82dc4cb

File tree

2 files changed

+31
-8
lines changed

2 files changed

+31
-8
lines changed

.travis.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ install:
5959
- if [ ! -f download-cache/pcre-$PCRE_VER.tar.gz ]; then wget -P download-cache http://ftp.cs.stanford.edu/pub/exim/pcre/pcre-$PCRE_VER.tar.gz; fi
6060
- git clone https://github.com/openresty/openresty.git ../openresty
6161
- git clone https://github.com/openresty/openresty-devel-utils.git
62-
- git clone https://github.com/openresty/resty-cli.git ../resty-cli
6362
- git clone https://github.com/simpl/ngx_devel_kit.git ../ndk-nginx-module
6463
- git clone https://github.com/openresty/lua-nginx-module.git ../lua-nginx-module
6564
- git clone https://github.com/openresty/no-pool-nginx.git ../no-pool-nginx
@@ -98,13 +97,12 @@ script:
9897
- export PATH=$PWD/apps:$PATH
9998
- openssl version
10099
- cd ..
101-
- export PATH=$PWD/work/nginx/sbin:$PWD/openresty-devel-utils:$PWD/../resty-cli/bin:$PATH
100+
- export PATH=$PWD/work/nginx/sbin:$PWD/openresty-devel-utils:$PATH
102101
- export LD_PRELOAD=$PWD/mockeagain/mockeagain.so
103102
- export LD_LIBRARY_PATH=$PWD/mockeagain:$LD_LIBRARY_PATH
104103
- export TEST_NGINX_RESOLVER=8.8.4.4
105104
- export NGX_BUILD_CC=$CC
106105
- ngx-build $NGINX_VERSION --with-ipv6 --with-http_realip_module --with-http_ssl_module --with-pcre-jit --with-cc-opt="-I$OPENSSL_INC -I$PCRE_INC" --with-ld-opt="-L$OPENSSL_LIB -Wl,-rpath,$OPENSSL_LIB -L$PCRE_LIB -Wl,-rpath,$PCRE_LIB" --add-module=../ndk-nginx-module --add-module=../echo-nginx-module --add-module=../set-misc-nginx-module --add-module=../headers-more-nginx-module --add-module=../lua-nginx-module --with-debug --with-stream_ssl_module --with-stream --with-ipv6 --add-module=../stream-lua-nginx-module > build.log 2>&1 || (cat build.log && exit 1)
107106
- nginx -V
108107
- ldd `which nginx`|grep -E 'luajit|ssl|pcre'
109-
- resty -V
110108
- prove -Itest-nginx/lib -j$JOBS -r t

t/pipe.t

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ _EOC_
3232
});
3333

3434
$ENV{TEST_NGINX_HTML_DIR} ||= html_dir();
35-
$ENV{TEST_NGINX_LIB_DIR} ||= $t::TestCore::pwd;
35+
$ENV{TEST_NGINX_LUA_PACKAGE_PATH} = "$t::TestCore::lua_package_path";
3636

3737
env_to_nginx("PATH");
3838
no_long_string();
@@ -1358,11 +1358,17 @@ lua pipe kill process:
13581358
--- config
13591359
location = /t {
13601360
content_by_lua_block {
1361+
local function get_ngx_bin_path()
1362+
local ffi = require "ffi"
1363+
ffi.cdef[[char **ngx_argv;]]
1364+
return ffi.string(ffi.C.ngx_argv[0])
1365+
end
1366+
1367+
local conf_file = "$TEST_NGINX_HTML_DIR/nginx.conf"
1368+
local nginx = get_ngx_bin_path()
1369+
1370+
local cmd = nginx .. " -p $TEST_NGINX_HTML_DIR -c " .. conf_file
13611371
local ngx_pipe = require "ngx.pipe"
1362-
local cmd = [[resty -I $TEST_NGINX_LIB_DIR/lib]]
1363-
.. [[ --nginx `which nginx`]]
1364-
.. [[ -e 'print(require "ngx.pipe".spawn{"no-such-cmd"}]]
1365-
.. [[:wait())']]
13661372
local proc, err = ngx_pipe.spawn(cmd)
13671373
if not proc then
13681374
ngx.log(ngx.ERR, err)
@@ -1378,6 +1384,25 @@ lua pipe kill process:
13781384
ngx.say(data)
13791385
}
13801386
}
1387+
--- user_files
1388+
>>> nginx.conf
1389+
events {
1390+
worker_connections 64;
1391+
}
1392+
error_log stderr error;
1393+
daemon off;
1394+
master_process off;
1395+
worker_processes 1;
1396+
http {
1397+
lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH";
1398+
init_worker_by_lua_block {
1399+
ngx.timer.at(0, function()
1400+
require "ngx.pipe".spawn{"no-such-cmd"}:wait()
1401+
os.exit(0)
1402+
end)
1403+
}
1404+
}
1405+
>>> logs/error.log
13811406
--- response_body_like
13821407
lua pipe child execvp\(\) failed while executing no-such-cmd \(2: No such file or directory\)
13831408

0 commit comments

Comments
 (0)