You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by mo...@apache.org on 2023/05/07 11:15:53 UTC

[apisix] branch master updated: chore(test): split the access log of apisix and test server (#8819)

This is an automated email from the ASF dual-hosted git repository.

monkeydluffy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix.git


The following commit(s) were added to refs/heads/master by this push:
     new 49f738fe9 chore(test): split the access log of apisix and test server (#8819)
49f738fe9 is described below

commit 49f738fe99c0301150ad9b2fd3a1461c1828c16d
Author: soulbird <zh...@outlook.com>
AuthorDate: Sun May 7 19:15:46 2023 +0800

    chore(test): split the access log of apisix and test server (#8819)
---
 t/APISIX.pm                         | 6 ++++++
 t/lib/server.lua                    | 1 +
 t/plugin/ext-plugin/http-req-call.t | 4 ++--
 3 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/t/APISIX.pm b/t/APISIX.pm
index b45c00bf1..5ab486dc4 100644
--- a/t/APISIX.pm
+++ b/t/APISIX.pm
@@ -648,6 +648,8 @@ _EOC_
         $ipv6_fake_server
         server_tokens off;
 
+        access_log logs/fake-server-access.log main;
+
         location / {
             content_by_lua_block {
                 require("lib.server").go()
@@ -673,6 +675,8 @@ _EOC_
     $http_config .= <<_EOC_;
         server_tokens off;
 
+        access_log logs/fake-server-access.log main;
+
         ssl_certificate_by_lua_block {
             local ngx_ssl = require "ngx.ssl"
             ngx.log(ngx.WARN, "Receive SNI: ", ngx_ssl.server_name())
@@ -710,6 +714,8 @@ _EOC_
             apisix.http_ssl_phase()
         }
 
+        access_log logs/access.log main;
+
         set \$dubbo_service_name          '';
         set \$dubbo_service_version       '';
         set \$dubbo_method                '';
diff --git a/t/lib/server.lua b/t/lib/server.lua
index 542c6eaef..c7386e1b7 100644
--- a/t/lib/server.lua
+++ b/t/lib/server.lua
@@ -570,6 +570,7 @@ function _M.go()
     local action = string.sub(ngx.var.uri, 2)
     action = string.gsub(action, "[/\\.-]", "_")
     if not action or not _M[action] then
+        ngx.log(ngx.WARN, "undefined path in test server, uri: ", ngx.var.request_uri)
         return ngx.exit(404)
     end
 
diff --git a/t/plugin/ext-plugin/http-req-call.t b/t/plugin/ext-plugin/http-req-call.t
index 7d4f678b7..6fc8240a7 100644
--- a/t/plugin/ext-plugin/http-req-call.t
+++ b/t/plugin/ext-plugin/http-req-call.t
@@ -514,8 +514,8 @@ GET /hello
             ext.go({rewrite_bad_path = true})
         }
     }
---- access_log
-GET /plugin_proxy_rewrite_args%3Fa=2
+--- error_log
+undefined path in test server, uri: /plugin_proxy_rewrite_args%3Fa=2
 --- error_code: 404