From a89b4d18951eb14093649109dc9514395220e67d Mon Sep 17 00:00:00 2001 From: Aapo Talvensaari Date: Mon, 10 Jun 2024 12:46:02 +0300 Subject: [PATCH] style(tests): reindex Test::Nginx tests (#13187) ### Summary Just reindex Test::Nginx tests with `reindex` found at: https://github.com/openresty/openresty-devel-utils/blob/master/reindex Signed-off-by: Aapo Talvensaari (cherry picked from commit fd994be71bf09405e00048518a0c7f4d8364e009) --- t/01-pdk/02-log/00-phase_checks.t | 2 -- t/01-pdk/02-log/05-set_serialize_value.t | 10 ++++++++-- t/01-pdk/04-request/21-get_uri_captures.t | 2 -- t/01-pdk/08-response/05-set_header.t | 3 ++- t/01-pdk/08-response/11-exit.t | 2 -- t/01-pdk/08-response/13-error.t | 1 + t/01-pdk/10-nginx/02-get_statistics.t | 3 +-- t/01-pdk/15-tracing/01-context.t | 2 ++ t/03-dns-client/02-timer-usage.t | 1 + t/04-patch/01-ngx-buf-double-free.t | 1 + t/04-patch/02-ngx-read-body-block.t | 4 +++- 11 files changed, 19 insertions(+), 12 deletions(-) diff --git a/t/01-pdk/02-log/00-phase_checks.t b/t/01-pdk/02-log/00-phase_checks.t index cef91c1755c6..fc49d609f34f 100644 --- a/t/01-pdk/02-log/00-phase_checks.t +++ b/t/01-pdk/02-log/00-phase_checks.t @@ -237,5 +237,3 @@ qq{ GET /t --- no_error_log [error] - - diff --git a/t/01-pdk/02-log/05-set_serialize_value.t b/t/01-pdk/02-log/05-set_serialize_value.t index 2776ddf612b7..0adfcfbed668 100644 --- a/t/01-pdk/02-log/05-set_serialize_value.t +++ b/t/01-pdk/02-log/05-set_serialize_value.t @@ -35,6 +35,7 @@ mode false mode must be 'set', 'add' or 'replace' [error] + === TEST 2: kong.log.serialize() rejects invalid values, including self-referencial tables --- http_config eval: $t::Util::HttpConfig --- config @@ -64,6 +65,7 @@ self_ref false value must be nil, a number, string, boolean or a non-self-refere [error] + === TEST 3: kong.log.set_serialize_value stores changes on ngx.ctx.serialize_values --- http_config eval: $t::Util::HttpConfig --- config @@ -91,6 +93,7 @@ GET /t [error] + === TEST 4: kong.log.set_serialize_value() sets, adds and replaces values with simple keys --- http_config eval: $t::Util::HttpConfig --- config @@ -139,6 +142,7 @@ add existing value does not set it true [error] + === TEST 5: kong.log.set_serialize_value sets, adds and replaces values with keys with dots --- http_config eval: $t::Util::HttpConfig --- config @@ -248,6 +252,8 @@ complex true --- no_error_log [error] + + === TEST 7: kong.log.set_serialize_value() setting values to nil --- http_config eval: $t::Util::HttpConfig --- config @@ -287,6 +293,8 @@ request.headers.authorization true --- no_error_log [error] + + === TEST 8: kong.log.serialize() redactes authorization headers by default --- http_config eval: $t::Util::HttpConfig --- config @@ -325,5 +333,3 @@ Proxy-Authorization REDACTED PROXY_AUTHORIZATION REDACTED --- no_error_log [error] - - diff --git a/t/01-pdk/04-request/21-get_uri_captures.t b/t/01-pdk/04-request/21-get_uri_captures.t index bd2d977df935..576623e1e474 100644 --- a/t/01-pdk/04-request/21-get_uri_captures.t +++ b/t/01-pdk/04-request/21-get_uri_captures.t @@ -39,5 +39,3 @@ GET /t/01/ok uri_captures: tag: /ok, 0: /t/01/ok, 1: /01/ok, 2: /01, 3: /ok --- no_error_log [error] - - diff --git a/t/01-pdk/08-response/05-set_header.t b/t/01-pdk/08-response/05-set_header.t index ed4cf1fea607..130f735c809b 100644 --- a/t/01-pdk/08-response/05-set_header.t +++ b/t/01-pdk/08-response/05-set_header.t @@ -280,7 +280,8 @@ Transfer-Encoding: chunked manually setting Transfer-Encoding. Ignored. -=== TEST 8: response.set_header() with header table + +=== TEST 9: response.set_header() with header table --- http_config eval: $t::Util::HttpConfig --- config location = /t { diff --git a/t/01-pdk/08-response/11-exit.t b/t/01-pdk/08-response/11-exit.t index 4a6f7a624c92..d86ea99088e7 100644 --- a/t/01-pdk/08-response/11-exit.t +++ b/t/01-pdk/08-response/11-exit.t @@ -1178,5 +1178,3 @@ Content-Type: application/json; charset=utf-8 {"n":9007199254740992} --- no_error_log [error] - - diff --git a/t/01-pdk/08-response/13-error.t b/t/01-pdk/08-response/13-error.t index 047850b44b24..b65924f8f179 100644 --- a/t/01-pdk/08-response/13-error.t +++ b/t/01-pdk/08-response/13-error.t @@ -454,6 +454,7 @@ grpc-message: ResourceExhausted [error] + === TEST 15: service.response.error() honors values of multiple Accept headers --- http_config eval: $t::Util::HttpConfig --- config diff --git a/t/01-pdk/10-nginx/02-get_statistics.t b/t/01-pdk/10-nginx/02-get_statistics.t index 087cdb2bca4a..2b0ac7d535b8 100644 --- a/t/01-pdk/10-nginx/02-get_statistics.t +++ b/t/01-pdk/10-nginx/02-get_statistics.t @@ -20,7 +20,6 @@ run_tests(); __DATA__ - === TEST 1: nginx.get_statistics() returns Nginx connections and requests states --- http_config eval: $t::Util::HttpConfig @@ -54,4 +53,4 @@ connections_waiting: \d+ connections_accepted: \d+ connections_handled: \d+/ --- no_error_log -[error] \ No newline at end of file +[error] diff --git a/t/01-pdk/15-tracing/01-context.t b/t/01-pdk/15-tracing/01-context.t index d1e1b1210524..d8a0f5bf0451 100644 --- a/t/01-pdk/15-tracing/01-context.t +++ b/t/01-pdk/15-tracing/01-context.t @@ -32,6 +32,7 @@ nil [error] + === TEST 2: tracer.set_active_span() sets active span --- http_config eval: $t::Util::HttpConfig --- config @@ -57,6 +58,7 @@ access [error] + === TEST 3: tracer.active_span() get tracer from active span --- http_config eval: $t::Util::HttpConfig --- config diff --git a/t/03-dns-client/02-timer-usage.t b/t/03-dns-client/02-timer-usage.t index 73c35ccb1c4e..43572ad5058d 100644 --- a/t/03-dns-client/02-timer-usage.t +++ b/t/03-dns-client/02-timer-usage.t @@ -8,6 +8,7 @@ no_shuffle(); run_tests(); __DATA__ + === TEST 1: stale result triggers async timer --- config location = /t { diff --git a/t/04-patch/01-ngx-buf-double-free.t b/t/04-patch/01-ngx-buf-double-free.t index 10612e7912ec..699083db27c2 100644 --- a/t/04-patch/01-ngx-buf-double-free.t +++ b/t/04-patch/01-ngx-buf-double-free.t @@ -7,6 +7,7 @@ repeat_each(2); run_tests(); __DATA__ + === TEST 1: one buf was linked to multiple ngx_chain_t nodes --- config location /t { diff --git a/t/04-patch/02-ngx-read-body-block.t b/t/04-patch/02-ngx-read-body-block.t index a086b125704d..cfdc6cc650ff 100644 --- a/t/04-patch/02-ngx-read-body-block.t +++ b/t/04-patch/02-ngx-read-body-block.t @@ -28,6 +28,8 @@ true err: nil [error] [alert] + + === TEST 2: ngx.req.read_body() should work for HTTP2 POST requests that doesn't carry the content-length header --- config location = /test { @@ -46,4 +48,4 @@ Content-Length: true err: nil --- no_error_log [error] -[alert] \ No newline at end of file +[alert]