Skip to content

Commit

Permalink
[t] use RESOLVER just when necessary
Browse files Browse the repository at this point in the history
* the second test does not need it
* and init_worker can get variables set by the env directive
  • Loading branch information
mikz committed Nov 29, 2017
1 parent 8b3d8d1 commit dc31685
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions t/resolver.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@ use lib 't';
use TestAPIcast 'no_plan';

$ENV{TEST_NGINX_HTTP_CONFIG} = "$TestAPIcast::path/http.d/*.conf";
$ENV{RESOLVER} = '127.0.1.1:5353';
$ENV{TEST_NGINX_RESOLVER} = '127.0.1.1:5353';

$ENV{TEST_NGINX_RESOLV_CONF} = "$Test::Nginx::Util::HtmlDir/resolv.conf";

env_to_nginx(
'RESOLVER'
);
master_on();
log_level('warn');
run_tests();
Expand All @@ -17,9 +14,11 @@ __DATA__
=== TEST 1: uses all resolvers
both RESOLVER env variable and resolvers in resolv.conf should be used
--- main_config
env RESOLVER=$TEST_NGINX_RESOLVER;
--- http_config
lua_package_path "$TEST_NGINX_LUA_PATH";
init_by_lua_block {
init_worker_by_lua_block {
require('resty.resolver').init('$TEST_NGINX_RESOLV_CONF')
}
--- config
Expand Down

0 comments on commit dc31685

Please sign in to comment.