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

spacewander 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 ab6e31f  test: clean unrun cases (#3356)
ab6e31f is described below

commit ab6e31fd639b63558025c16aaae9eab3b09dabd1
Author: 罗泽轩 <[email protected]>
AuthorDate: Wed Jan 20 05:14:56 2021 -0600

    test: clean unrun cases (#3356)
    
    Those test may mislead people.
    Also add a check to prevent skipping test by accident.
    
    Signed-off-by: spacewander <[email protected]>
---
 t/admin/routes.t               | 140 +++++++++++++++++------------------------
 t/admin/services-string-id.t   |  62 +++++-------------
 t/admin/services.t             |  90 +++++++++-----------------
 t/plugin/skywalking.t          |  24 ++-----
 t/plugin/zipkin.t              |  47 ++++----------
 utils/check-test-code-style.sh |   7 +++
 6 files changed, 129 insertions(+), 241 deletions(-)

diff --git a/t/admin/routes.t b/t/admin/routes.t
index 7f51420..c96e9c4 100644
--- a/t/admin/routes.t
+++ b/t/admin/routes.t
@@ -353,35 +353,7 @@ GET /t
 
 
 
-=== TEST 8: invalid empty plugins (todo)
-    location /t {
-        content_by_lua_block {
-            local core = require("apisix.core")
-            local t = require("lib.test_admin").test
-            local code, message, res = t('/apisix/admin/routes/1',
-                 ngx.HTTP_PUT,
-                 [[{
-                        "uri": "/index.html"
-                }]]
-                )
-
-            if code ~= 200 then
-                ngx.status = code
-                ngx.print(message)
-                return
-            end
-
-            ngx.say("[push] code: ", code, " message: ", message)
-        }
-    }
---- request
-GET /t
---- error_code: 400
---- SKIP
-
-
-
-=== TEST 9: invalid route: duplicate method
+=== TEST 8: invalid route: duplicate method
 --- config
     location /t {
         content_by_lua_block {
@@ -413,7 +385,7 @@ GET /t
 
 
 
-=== TEST 10: invalid method
+=== TEST 9: invalid method
 --- config
     location /t {
         content_by_lua_block {
@@ -440,7 +412,7 @@ GET /t
 
 
 
-=== TEST 11: invalid service id
+=== TEST 10: invalid service id
 --- config
     location /t {
         content_by_lua_block {
@@ -467,7 +439,7 @@ GET /t
 
 
 
-=== TEST 12: service id: not exist
+=== TEST 11: service id: not exist
 --- config
     location /t {
         content_by_lua_block {
@@ -494,7 +466,7 @@ GET /t
 
 
 
-=== TEST 13: invalid id
+=== TEST 12: invalid id
 --- config
     location /t {
         content_by_lua_block {
@@ -521,7 +493,7 @@ GET /t
 
 
 
-=== TEST 14: id in the rule
+=== TEST 13: id in the rule
 --- config
     location /t {
         content_by_lua_block {
@@ -548,7 +520,7 @@ passed
 
 
 
-=== TEST 15: integer id less than 1
+=== TEST 14: integer id less than 1
 --- config
     location /t {
         content_by_lua_block {
@@ -575,7 +547,7 @@ GET /t
 
 
 
-=== TEST 16: invalid upstream_id
+=== TEST 15: invalid upstream_id
 --- config
     location /t {
         content_by_lua_block {
@@ -602,7 +574,7 @@ GET /t
 
 
 
-=== TEST 17: not exist upstream_id
+=== TEST 16: not exist upstream_id
 --- config
     location /t {
         content_by_lua_block {
@@ -629,7 +601,7 @@ GET /t
 
 
 
-=== TEST 18: wrong route id, do not need it
+=== TEST 17: wrong route id, do not need it
 --- config
     location /t {
         content_by_lua_block {
@@ -657,7 +629,7 @@ GET /t
 
 
 
-=== TEST 19: wrong route id, do not need it
+=== TEST 18: wrong route id, do not need it
 --- config
     location /t {
         content_by_lua_block {
@@ -684,7 +656,7 @@ GET /t
 
 
 
-=== TEST 20: limit-count with `disable` option
+=== TEST 19: limit-count with `disable` option
 --- config
     location /t {
         content_by_lua_block {
@@ -724,7 +696,7 @@ GET /t
 
 
 
-=== TEST 21: host: *.foo.com
+=== TEST 20: host: *.foo.com
 --- config
     location /t {
         content_by_lua_block {
@@ -772,7 +744,7 @@ passed
 
 
 
-=== TEST 22: invalid host: a.*.foo.com
+=== TEST 21: invalid host: a.*.foo.com
 --- config
     location /t {
         content_by_lua_block {
@@ -805,7 +777,7 @@ GET /t
 
 
 
-=== TEST 23: invalid host: *.a.*.foo.com
+=== TEST 22: invalid host: *.a.*.foo.com
 --- config
     location /t {
         content_by_lua_block {
@@ -838,7 +810,7 @@ GET /t
 
 
 
-=== TEST 24: remote_addr: 127.0.0.1
+=== TEST 23: remote_addr: 127.0.0.1
 --- config
     location /t {
         content_by_lua_block {
@@ -888,7 +860,7 @@ passed
 
 
 
-=== TEST 25: remote_addr: 127.0.0.1/24
+=== TEST 24: remote_addr: 127.0.0.1/24
 --- config
     location /t {
         content_by_lua_block {
@@ -938,7 +910,7 @@ passed
 
 
 
-=== TEST 26: remote_addr: 127.0.0.33333
+=== TEST 25: remote_addr: 127.0.0.33333
 --- config
     location /t {
         content_by_lua_block {
@@ -973,7 +945,7 @@ GET /t
 
 
 
-=== TEST 27: all method
+=== TEST 26: all method
 --- config
     location /t {
         content_by_lua_block {
@@ -1006,7 +978,7 @@ passed
 
 
 
-=== TEST 28: patch route(new uri)
+=== TEST 27: patch route(new uri)
 --- config
     location /t {
         content_by_lua_block {
@@ -1054,7 +1026,7 @@ passed
 
 
 
-=== TEST 29: patch route(multi)
+=== TEST 28: patch route(multi)
 --- config
     location /t {
         content_by_lua_block {
@@ -1105,7 +1077,7 @@ passed
 
 
 
-=== TEST 30: patch route(new methods)
+=== TEST 29: patch route(new methods)
 --- config
     location /t {
         content_by_lua_block {
@@ -1139,7 +1111,7 @@ passed
 
 
 
-=== TEST 31: patch route(minus methods)
+=== TEST 30: patch route(minus methods)
 --- config
     location /t {
         content_by_lua_block {
@@ -1173,7 +1145,7 @@ passed
 
 
 
-=== TEST 32: patch route(new methods - sub path way)
+=== TEST 31: patch route(new methods - sub path way)
 --- config
     location /t {
         content_by_lua_block {
@@ -1207,7 +1179,7 @@ passed
 
 
 
-=== TEST 33: patch route(new uri)
+=== TEST 32: patch route(new uri)
 --- config
     location /t {
         content_by_lua_block {
@@ -1239,7 +1211,7 @@ passed
 
 
 
-=== TEST 34: patch route(whole)
+=== TEST 33: patch route(whole)
 --- config
     location /t {
         content_by_lua_block {
@@ -1291,7 +1263,7 @@ passed
 
 
 
-=== TEST 35: multiple hosts
+=== TEST 34: multiple hosts
 --- config
     location /t {
         content_by_lua_block {
@@ -1331,7 +1303,7 @@ passed
 
 
 
-=== TEST 36: enable hosts and host together
+=== TEST 35: enable hosts and host together
 --- config
     location /t {
         content_by_lua_block {
@@ -1366,7 +1338,7 @@ GET /t
 
 
 
-=== TEST 37: multiple remote_addrs
+=== TEST 36: multiple remote_addrs
 --- config
     location /t {
         content_by_lua_block {
@@ -1406,7 +1378,7 @@ passed
 
 
 
-=== TEST 38: multiple vars
+=== TEST 37: multiple vars
 --- config
     location /t {
         content_by_lua_block {
@@ -1446,7 +1418,7 @@ passed
 
 
 
-=== TEST 39: filter function
+=== TEST 38: filter function
 --- config
     location /t {
         content_by_lua_block {
@@ -1485,7 +1457,7 @@ passed
 
 
 
-=== TEST 40: filter function (invalid)
+=== TEST 39: filter function (invalid)
 --- config
     location /t {
         content_by_lua_block {
@@ -1518,7 +1490,7 @@ GET /t
 
 
 
-=== TEST 41: Support for multiple URIs
+=== TEST 40: Support for multiple URIs
 --- config
     location /t {
         content_by_lua_block {
@@ -1549,7 +1521,7 @@ passed
 
 
 
-=== TEST 42: set route with ttl
+=== TEST 41: set route with ttl
 --- config
 location /t {
     content_by_lua_block {
@@ -1614,7 +1586,7 @@ message: Key not found
 
 
 
-=== TEST 43: post route with ttl
+=== TEST 42: post route with ttl
 --- config
 location /t {
     content_by_lua_block {
@@ -1664,7 +1636,7 @@ message: Key not found
 
 
 
-=== TEST 44: invalid argument: ttl
+=== TEST 43: invalid argument: ttl
 --- config
 location /t {
     content_by_lua_block {
@@ -1701,7 +1673,7 @@ GET /t
 
 
 
-=== TEST 45: set route(id: 1, check priority)
+=== TEST 44: set route(id: 1, check priority)
 --- config
     location /t {
         content_by_lua_block {
@@ -1743,7 +1715,7 @@ passed
 
 
 
-=== TEST 46: set route(id: 1 + priority: 0)
+=== TEST 45: set route(id: 1 + priority: 0)
 --- config
     location /t {
         content_by_lua_block {
@@ -1786,7 +1758,7 @@ passed
 
 
 
-=== TEST 47: set route(id: 1) and upstream(type:chash, default hash_on: vars, 
missing key)
+=== TEST 46: set route(id: 1) and upstream(type:chash, default hash_on: vars, 
missing key)
 --- config
     location /t {
         content_by_lua_block {
@@ -1818,7 +1790,7 @@ GET /t
 
 
 
-=== TEST 48: set route(id: 1) and upstream(type:chash, hash_on: header, 
missing key)
+=== TEST 47: set route(id: 1) and upstream(type:chash, hash_on: header, 
missing key)
 --- config
     location /t {
         content_by_lua_block {
@@ -1851,7 +1823,7 @@ GET /t
 
 
 
-=== TEST 49: set route(id: 1) and upstream(type:chash, hash_on: cookie, 
missing key)
+=== TEST 48: set route(id: 1) and upstream(type:chash, hash_on: cookie, 
missing key)
 --- config
     location /t {
         content_by_lua_block {
@@ -1884,7 +1856,7 @@ GET /t
 
 
 
-=== TEST 50: set route(id: 1) and upstream(type:chash, hash_on: consumer, 
missing key is ok)
+=== TEST 49: set route(id: 1) and upstream(type:chash, hash_on: consumer, 
missing key is ok)
 --- config
     location /t {
         content_by_lua_block {
@@ -1916,7 +1888,7 @@ passed
 
 
 
-=== TEST 51: set route(id: 1 + name: test name)
+=== TEST 50: set route(id: 1 + name: test name)
 --- config
     location /t {
         content_by_lua_block {
@@ -1958,7 +1930,7 @@ passed
 
 
 
-=== TEST 52: string id
+=== TEST 51: string id
 --- config
     location /t {
         content_by_lua_block {
@@ -1990,7 +1962,7 @@ passed
 
 
 
-=== TEST 53: string id(delete)
+=== TEST 52: string id(delete)
 --- config
     location /t {
         content_by_lua_block {
@@ -2013,7 +1985,7 @@ passed
 
 
 
-=== TEST 54: invalid string id
+=== TEST 53: invalid string id
 --- config
     location /t {
         content_by_lua_block {
@@ -2044,7 +2016,7 @@ GET /t
 
 
 
-=== TEST 55: Verify Response Content-Type=applciation/json
+=== TEST 54: Verify Response Content-Type=applciation/json
 --- config
     location /t {
         content_by_lua_block {
@@ -2071,7 +2043,7 @@ Content-Type: application/json
 
 
 
-=== TEST 56: set route with size 36k (temporary file to store request body)
+=== TEST 55: set route with size 36k (temporary file to store request body)
 --- config
     location /t {
         content_by_lua_block {
@@ -2110,7 +2082,7 @@ a client request body is buffered to a temporary file
 
 
 
-=== TEST 57: route size more than 1.5 MiB
+=== TEST 56: route size more than 1.5 MiB
 --- config
     location /t {
         content_by_lua_block {
@@ -2144,7 +2116,7 @@ failed to read request body: request size 1678025 is 
greater than the maximum si
 
 
 
-=== TEST 58: uri + plugins + script  failed
+=== TEST 57: uri + plugins + script  failed
 --- config
     location /t {
         content_by_lua_block {
@@ -2183,7 +2155,7 @@ GET /t
 
 
 
-=== TEST 59: invalid route: multi nodes with `node` mode to pass host
+=== TEST 58: invalid route: multi nodes with `node` mode to pass host
 --- config
     location /t {
         content_by_lua_block {
@@ -2216,7 +2188,7 @@ GET /t
 
 
 
-=== TEST 60: set route(with labels)
+=== TEST 59: set route(with labels)
 --- config
     location /t {
         content_by_lua_block {
@@ -2277,7 +2249,7 @@ passed
 
 
 
-=== TEST 61: patch route(change labels)
+=== TEST 60: patch route(change labels)
 --- config
     location /t {
         content_by_lua_block {
@@ -2327,7 +2299,7 @@ passed
 
 
 
-=== TEST 62: invalid format of label value: set route
+=== TEST 61: invalid format of label value: set route
 --- config
     location /t {
         content_by_lua_block {
@@ -2357,7 +2329,7 @@ GET /t
 
 
 
-=== TEST 63: create route with create_time and update_time(id : 1)
+=== TEST 62: create route with create_time and update_time(id : 1)
 --- config
     location /t {
         content_by_lua_block {
@@ -2407,7 +2379,7 @@ passed
 
 
 
-=== TEST 64: delete test route(id : 1)
+=== TEST 63: delete test route(id : 1)
 --- config
     location /t {
         content_by_lua_block {
diff --git a/t/admin/services-string-id.t b/t/admin/services-string-id.t
index 9c7d10f..aa116c0 100644
--- a/t/admin/services-string-id.t
+++ b/t/admin/services-string-id.t
@@ -320,35 +320,7 @@ GET /t
 
 
 
-=== TEST 8: invalid empty plugins (todo)
-    location /t {
-        content_by_lua_block {
-            local core = require("apisix.core")
-            local t = require("lib.test_admin").test
-            local code, message, res = 
t('/apisix/admin/services/5eeb3dc90f747328b2930b0b',
-                 ngx.HTTP_PUT,
-                 [[{
-                    "plugins": {}
-                }]]
-                )
-
-            if code ~= 200 then
-                ngx.status = code
-                ngx.print(message)
-                return
-            end
-
-            ngx.say("[push] code: ", code, " message: ", message)
-        }
-    }
---- request
-GET /t
---- error_code: 400
---- SKIP
-
-
-
-=== TEST 9: invalid service id
+=== TEST 8: invalid service id
 --- config
     location /t {
         content_by_lua_block {
@@ -378,7 +350,7 @@ GET /t
 
 
 
-=== TEST 10: invalid id
+=== TEST 9: invalid id
 --- config
     location /t {
         content_by_lua_block {
@@ -405,7 +377,7 @@ GET /t
 
 
 
-=== TEST 11: id in the rule
+=== TEST 10: id in the rule
 --- config
     location /t {
         content_by_lua_block {
@@ -440,7 +412,7 @@ passed
 
 
 
-=== TEST 12: integer id less than 1
+=== TEST 11: integer id less than 1
 --- config
     location /t {
         content_by_lua_block {
@@ -467,7 +439,7 @@ GET /t
 
 
 
-=== TEST 13: invalid service id: contains symbols value
+=== TEST 12: invalid service id: contains symbols value
 --- config
     location /t {
         content_by_lua_block {
@@ -494,7 +466,7 @@ GET /t
 
 
 
-=== TEST 14: no additional properties is valid
+=== TEST 13: no additional properties is valid
 --- config
     location /t {
         content_by_lua_block {
@@ -521,7 +493,7 @@ GET /t
 
 
 
-=== TEST 15: invalid upstream_id
+=== TEST 14: invalid upstream_id
 --- config
     location /t {
         content_by_lua_block {
@@ -548,7 +520,7 @@ GET /t
 
 
 
-=== TEST 16: not exist upstream_id
+=== TEST 15: not exist upstream_id
 --- config
     location /t {
         content_by_lua_block {
@@ -575,7 +547,7 @@ GET /t
 
 
 
-=== TEST 17: wrong service id
+=== TEST 16: wrong service id
 --- config
     location /t {
         content_by_lua_block {
@@ -601,7 +573,7 @@ GET /t
 
 
 
-=== TEST 18: wrong service id
+=== TEST 17: wrong service id
 --- config
     location /t {
         content_by_lua_block {
@@ -628,7 +600,7 @@ GET /t
 
 
 
-=== TEST 19: patch service(whole)
+=== TEST 18: patch service(whole)
 --- config
     location /t {
         content_by_lua_block {
@@ -674,7 +646,7 @@ passed
 
 
 
-=== TEST 20: patch service(new desc)
+=== TEST 19: patch service(new desc)
 --- config
     location /t {
         content_by_lua_block {
@@ -714,7 +686,7 @@ passed
 
 
 
-=== TEST 21: patch service(new nodes)
+=== TEST 20: patch service(new nodes)
 --- config
     location /t {
         content_by_lua_block {
@@ -759,7 +731,7 @@ passed
 
 
 
-=== TEST 22: set service(id: 5eeb3dc90f747328b2930b0b) and 
upstream(type:chash, default hash_on: vars, missing key)
+=== TEST 21: set service(id: 5eeb3dc90f747328b2930b0b) and 
upstream(type:chash, default hash_on: vars, missing key)
 --- config
     location /t {
         content_by_lua_block {
@@ -790,7 +762,7 @@ GET /t
 
 
 
-=== TEST 23: set service(id: 5eeb3dc90f747328b2930b0b) and 
upstream(type:chash, hash_on: header, missing key)
+=== TEST 22: set service(id: 5eeb3dc90f747328b2930b0b) and 
upstream(type:chash, hash_on: header, missing key)
 --- config
     location /t {
         content_by_lua_block {
@@ -822,7 +794,7 @@ GET /t
 
 
 
-=== TEST 24: set service(id: 5eeb3dc90f747328b2930b0b) and 
upstream(type:chash, hash_on: cookie, missing key)
+=== TEST 23: set service(id: 5eeb3dc90f747328b2930b0b) and 
upstream(type:chash, hash_on: cookie, missing key)
 --- config
     location /t {
         content_by_lua_block {
@@ -854,7 +826,7 @@ GET /t
 
 
 
-=== TEST 25: set service(id: 5eeb3dc90f747328b2930b0b) and 
upstream(type:chash, hash_on: consumer, missing key is ok)
+=== TEST 24: set service(id: 5eeb3dc90f747328b2930b0b) and 
upstream(type:chash, hash_on: consumer, missing key is ok)
 --- config
     location /t {
         content_by_lua_block {
diff --git a/t/admin/services.t b/t/admin/services.t
index 1daa6e3..1bf4501 100644
--- a/t/admin/services.t
+++ b/t/admin/services.t
@@ -334,35 +334,7 @@ GET /t
 
 
 
-=== TEST 8: invalid empty plugins (todo)
-    location /t {
-        content_by_lua_block {
-            local core = require("apisix.core")
-            local t = require("lib.test_admin").test
-            local code, message, res = t('/apisix/admin/services/1',
-                 ngx.HTTP_PUT,
-                 [[{
-                    "plugins": {}
-                }]]
-                )
-
-            if code ~= 200 then
-                ngx.status = code
-                ngx.print(message)
-                return
-            end
-
-            ngx.say("[push] code: ", code, " message: ", message)
-        }
-    }
---- request
-GET /t
---- error_code: 400
---- SKIP
-
-
-
-=== TEST 9: invalid service id
+=== TEST 8: invalid service id
 --- config
     location /t {
         content_by_lua_block {
@@ -392,7 +364,7 @@ GET /t
 
 
 
-=== TEST 10: invalid id
+=== TEST 9: invalid id
 --- config
     location /t {
         content_by_lua_block {
@@ -419,7 +391,7 @@ GET /t
 
 
 
-=== TEST 11: id in the rule
+=== TEST 10: id in the rule
 --- config
     location /t {
         content_by_lua_block {
@@ -454,7 +426,7 @@ passed
 
 
 
-=== TEST 12: integer id less than 1
+=== TEST 11: integer id less than 1
 --- config
     location /t {
         content_by_lua_block {
@@ -481,7 +453,7 @@ GET /t
 
 
 
-=== TEST 13: invalid service id: string value
+=== TEST 12: invalid service id: string value
 --- config
     location /t {
         content_by_lua_block {
@@ -508,7 +480,7 @@ GET /t
 
 
 
-=== TEST 14: no additional properties is valid
+=== TEST 13: no additional properties is valid
 --- config
     location /t {
         content_by_lua_block {
@@ -535,7 +507,7 @@ GET /t
 
 
 
-=== TEST 15: invalid upstream_id
+=== TEST 14: invalid upstream_id
 --- config
     location /t {
         content_by_lua_block {
@@ -562,7 +534,7 @@ GET /t
 
 
 
-=== TEST 16: not exist upstream_id
+=== TEST 15: not exist upstream_id
 --- config
     location /t {
         content_by_lua_block {
@@ -589,7 +561,7 @@ GET /t
 
 
 
-=== TEST 17: wrong service id
+=== TEST 16: wrong service id
 --- config
     location /t {
         content_by_lua_block {
@@ -615,7 +587,7 @@ GET /t
 
 
 
-=== TEST 18: wrong service id
+=== TEST 17: wrong service id
 --- config
     location /t {
         content_by_lua_block {
@@ -642,7 +614,7 @@ GET /t
 
 
 
-=== TEST 19: patch service(whole)
+=== TEST 18: patch service(whole)
 --- config
     location /t {
         content_by_lua_block {
@@ -702,7 +674,7 @@ passed
 
 
 
-=== TEST 20: patch service(new desc)
+=== TEST 19: patch service(new desc)
 --- config
     location /t {
         content_by_lua_block {
@@ -742,7 +714,7 @@ passed
 
 
 
-=== TEST 21: patch service(new nodes)
+=== TEST 20: patch service(new nodes)
 --- config
     location /t {
         content_by_lua_block {
@@ -787,7 +759,7 @@ passed
 
 
 
-=== TEST 22: patch service(whole - sub path)
+=== TEST 21: patch service(whole - sub path)
 --- config
     location /t {
         content_by_lua_block {
@@ -833,7 +805,7 @@ passed
 
 
 
-=== TEST 23: patch service(new desc - sub path)
+=== TEST 22: patch service(new desc - sub path)
 --- config
     location /t {
         content_by_lua_block {
@@ -871,7 +843,7 @@ passed
 
 
 
-=== TEST 24: patch service(new nodes - sub path)
+=== TEST 23: patch service(new nodes - sub path)
 --- config
     location /t {
         content_by_lua_block {
@@ -913,7 +885,7 @@ passed
 
 
 
-=== TEST 25: set service(id: 1) and upstream(type:chash, default hash_on: 
vars, missing key)
+=== TEST 24: set service(id: 1) and upstream(type:chash, default hash_on: 
vars, missing key)
 --- config
     location /t {
         content_by_lua_block {
@@ -944,7 +916,7 @@ GET /t
 
 
 
-=== TEST 26: set service(id: 1) and upstream(type:chash, hash_on: header, 
missing key)
+=== TEST 25: set service(id: 1) and upstream(type:chash, hash_on: header, 
missing key)
 --- config
     location /t {
         content_by_lua_block {
@@ -976,7 +948,7 @@ GET /t
 
 
 
-=== TEST 27: set service(id: 1) and upstream(type:chash, hash_on: cookie, 
missing key)
+=== TEST 26: set service(id: 1) and upstream(type:chash, hash_on: cookie, 
missing key)
 --- config
     location /t {
         content_by_lua_block {
@@ -1008,7 +980,7 @@ GET /t
 
 
 
-=== TEST 28: set service(id: 1) and upstream(type:chash, hash_on: consumer, 
missing key is ok)
+=== TEST 27: set service(id: 1) and upstream(type:chash, hash_on: consumer, 
missing key is ok)
 --- config
     location /t {
         content_by_lua_block {
@@ -1039,7 +1011,7 @@ GET /t
 
 
 
-=== TEST 29: set service(id: 1 + test service name)
+=== TEST 28: set service(id: 1 + test service name)
 --- config
     location /t {
         content_by_lua_block {
@@ -1085,7 +1057,7 @@ passed
 
 
 
-=== TEST 30: invalid string id
+=== TEST 29: invalid string id
 --- config
     location /t {
         content_by_lua_block {
@@ -1116,7 +1088,7 @@ GET /t
 
 
 
-=== TEST 31: set empty service. (id: 1)(allow empty `service` object)
+=== TEST 30: set empty service. (id: 1)(allow empty `service` object)
 --- config
     location /t {
         content_by_lua_block {
@@ -1145,7 +1117,7 @@ passed
 
 
 
-=== TEST 32: patch content to the empty service.
+=== TEST 31: patch content to the empty service.
 --- config
     location /t {
         content_by_lua_block {
@@ -1210,7 +1182,7 @@ passed
 
 
 
-=== TEST 33: set service(with labels)
+=== TEST 32: set service(with labels)
 --- config
     location /t {
         content_by_lua_block {
@@ -1266,7 +1238,7 @@ passed
 
 
 
-=== TEST 34: patch service(change labels)
+=== TEST 33: patch service(change labels)
 --- config
     location /t {
         content_by_lua_block {
@@ -1313,7 +1285,7 @@ passed
 
 
 
-=== TEST 35: invalid format of label value: set service
+=== TEST 34: invalid format of label value: set service
 --- config
     location /t {
         content_by_lua_block {
@@ -1348,7 +1320,7 @@ GET /t
 
 
 
-=== TEST 36: create service with create_time and update_time(id: 1)
+=== TEST 35: create service with create_time and update_time(id: 1)
 --- config
     location /t {
         content_by_lua_block {
@@ -1396,7 +1368,7 @@ passed
 
 
 
-=== TEST 37: delete test service(id: 1)
+=== TEST 36: delete test service(id: 1)
 --- config
     location /t {
         content_by_lua_block {
@@ -1420,7 +1392,7 @@ GET /t
 
 
 
-=== TEST 38: limit the length of service's name
+=== TEST 37: limit the length of service's name
 --- config
     location /t {
         content_by_lua_block {
@@ -1444,7 +1416,7 @@ GET /t
 
 
 
-=== TEST 39: allow dot in the id
+=== TEST 38: allow dot in the id
 --- config
     location /t {
         content_by_lua_block {
diff --git a/t/plugin/skywalking.t b/t/plugin/skywalking.t
index cce7503..e58fb69 100644
--- a/t/plugin/skywalking.t
+++ b/t/plugin/skywalking.t
@@ -118,19 +118,7 @@ segments reported
 
 
 
-=== TEST 3: test heartbeat(TODO: need to update skywalking library)
---- request
-GET /opentracing
---- response_body
-opentracing
---- no_error_log
-[error]
---- wait: 4
---- SKIP
-
-
-
-=== TEST 4: change sample ratio
+=== TEST 3: change sample ratio
 --- config
     location /t {
         content_by_lua_block {
@@ -188,7 +176,7 @@ passed
 
 
 
-=== TEST 5: not trigger skywalking
+=== TEST 4: not trigger skywalking
 --- request
 GET /opentracing
 --- response_body
@@ -200,7 +188,7 @@ miss sampling, ignore
 
 
 
-=== TEST 6: disabled
+=== TEST 5: disabled
 --- config
     location /t {
         content_by_lua_block {
@@ -252,7 +240,7 @@ passed
 
 
 
-=== TEST 7: not trigger skywalking
+=== TEST 6: not trigger skywalking
 --- request
 GET /opentracing
 --- response_body
@@ -262,7 +250,7 @@ rewrite phase of skywalking plugin
 
 
 
-=== TEST 8: enable skywalking(sample_ratio=1)
+=== TEST 7: enable skywalking(sample_ratio=1)
 --- config
     location /t {
         content_by_lua_block {
@@ -320,7 +308,7 @@ passed
 
 
 
-=== TEST 9: test segments report
+=== TEST 8: test segments report
 --- request
 GET /opentracing
 --- response_body
diff --git a/t/plugin/zipkin.t b/t/plugin/zipkin.t
index 2ff9f65..1964a82 100644
--- a/t/plugin/zipkin.t
+++ b/t/plugin/zipkin.t
@@ -46,30 +46,7 @@ done
 
 
 
-=== TEST 2: default value of sample_ratio
---- config
-    location /t {
-        content_by_lua_block {
-            local plugin = require("apisix.plugins.zipkin")
-            local ok, err = plugin.check_schema({endpoint = 
'http://127.0.0.1'})
-            if not ok then
-                ngx.say(err)
-            end
-
-            ngx.say("done")
-        }
-    }
---- request
-GET /t
---- response_body
-done
---- no_error_log
-[error]
---- SKIP
-
-
-
-=== TEST 3: wrong value of ratio
+=== TEST 2: wrong value of ratio
 --- config
     location /t {
         content_by_lua_block {
@@ -92,7 +69,7 @@ done
 
 
 
-=== TEST 4: wrong value of ratio
+=== TEST 3: wrong value of ratio
 --- config
     location /t {
         content_by_lua_block {
@@ -115,7 +92,7 @@ done
 
 
 
-=== TEST 5: add plugin
+=== TEST 4: add plugin
 --- config
     location /t {
         content_by_lua_block {
@@ -177,7 +154,7 @@ passed
 
 
 
-=== TEST 6: tiger zipkin
+=== TEST 5: tiger zipkin
 --- request
 GET /opentracing
 --- error_log
@@ -187,7 +164,7 @@ report zipkin span failed
 
 
 
-=== TEST 7: change sample ratio
+=== TEST 6: change sample ratio
 --- config
     location /t {
         content_by_lua_block {
@@ -247,7 +224,7 @@ passed
 
 
 
-=== TEST 8: not tiger zipkin
+=== TEST 7: not tiger zipkin
 --- request
 GET /opentracing
 --- response_body
@@ -257,7 +234,7 @@ opentracing
 
 
 
-=== TEST 9: disabled
+=== TEST 8: disabled
 --- config
     location /t {
         content_by_lua_block {
@@ -309,7 +286,7 @@ passed
 
 
 
-=== TEST 10: not tiger zipkin
+=== TEST 9: not tiger zipkin
 --- request
 GET /opentracing
 --- response_body
@@ -319,7 +296,7 @@ opentracing
 
 
 
-=== TEST 11: set plugin with external ip address
+=== TEST 10: set plugin with external ip address
 --- config
     location /t {
         content_by_lua_block {
@@ -360,7 +337,7 @@ passed
 
 
 
-=== TEST 12: tiger zipkin
+=== TEST 11: tiger zipkin
 --- request
 GET /opentracing
 --- error_log
@@ -370,7 +347,7 @@ report zipkin span failed
 
 
 
-=== TEST 13: sanity server_addr
+=== TEST 12: sanity server_addr
 --- config
     location /t {
         content_by_lua_block {
@@ -396,7 +373,7 @@ property "server_addr" validation failed: failed to match 
pattern "^[0-9]{1,3}.[
 
 
 
-=== TEST 14: check not error with limit count
+=== TEST 13: check not error with limit count
 --- config
     location /t {
         content_by_lua_block {
diff --git a/utils/check-test-code-style.sh b/utils/check-test-code-style.sh
index b3e4f36..2f8a0aa 100755
--- a/utils/check-test-code-style.sh
+++ b/utils/check-test-code-style.sh
@@ -19,6 +19,13 @@
 
 set -x -euo pipefail
 
+find t -name '*.t' -exec grep -E "\-\-\-\s+(SKIP|ONLY|LAST)$" {} + > 
/tmp/error.log || true
+if [ -s /tmp/error.log ]; then
+    echo "Forbidden directives to found. Bypass test cases without reason are 
not allowed."
+    cat /tmp/error.log
+    exit 1
+fi
+
 find t -name '*.t' -exec ./utils/reindex {} + > \
     /tmp/check.log 2>&1 || (cat /tmp/check.log && exit 1)
 

Reply via email to