Skip to content

Commit

Permalink
Merge pull request #434 from 3scale/fix-tests-numbering
Browse files Browse the repository at this point in the history
Fix tests numbering
  • Loading branch information
mikz authored Sep 27, 2017
2 parents 21d21f8 + f48788a commit c0b5f28
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
24 changes: 12 additions & 12 deletions t/003-apicast.t
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ GET /?app_key=42
credentials missing!
--- error_code: 401
=== TEST 2: no mapping rules matched
=== TEST 3: no mapping rules matched
The message is configurable and status also.
--- http_config
lua_package_path "$TEST_NGINX_LUA_PATH";
Expand Down Expand Up @@ -98,7 +98,7 @@ no mapping rules!
--- error_log
could not find proxy for request
=== TEST 3: authentication credentials invalid
=== TEST 4: authentication credentials invalid
The message is configurable and default status is 403.
--- http_config
lua_package_path "$TEST_NGINX_LUA_PATH";
Expand Down Expand Up @@ -137,7 +137,7 @@ GET /?user_key=value
credentials invalid!
--- error_code: 402
=== TEST 4: api backend gets the request
=== TEST 5: api backend gets the request
It asks backend and then forwards the request to the api.
--- http_config
include $TEST_NGINX_UPSTREAM_CONFIG;
Expand Down Expand Up @@ -192,7 +192,7 @@ apicast cache miss key: 42:value:usage%5Bhits%5D=2
--- no_error_log
[error]
=== TEST 7: mapping rule with fixed value is mandatory
=== TEST 6: mapping rule with fixed value is mandatory
When mapping rule has a parameter with fixed value it has to be matched.
--- http_config
include $TEST_NGINX_UPSTREAM_CONFIG;
Expand Down Expand Up @@ -230,7 +230,7 @@ GET /foo?bar=foo&user_key=somekey
no mapping rules matched!
--- error_code: 412
=== TEST 8: mapping rule with fixed value is mandatory
=== TEST 7: mapping rule with fixed value is mandatory
When mapping rule has a parameter with fixed value it has to be matched.
--- http_config
include $TEST_NGINX_UPSTREAM_CONFIG;
Expand Down Expand Up @@ -275,7 +275,7 @@ X-3scale-matched-rules: /foo?bar=baz
--- no_error_log
[error]
=== TEST 9: mapping rule with variable value is required to be sent
=== TEST 8: mapping rule with variable value is required to be sent
When mapping rule has a parameter with variable value it has to exist.
--- http_config
include $TEST_NGINX_UPSTREAM_CONFIG;
Expand Down Expand Up @@ -320,7 +320,7 @@ X-3scale-matched-rules: /foo?bar={baz}
X-3scale-usage: usage%5Bbar%5D=3
=== TEST 10: https api backend works
=== TEST 9: https api backend works
--- http_config
include $TEST_NGINX_UPSTREAM_CONFIG;
Expand Down Expand Up @@ -389,7 +389,7 @@ GET /test?user_key=foo
api response
--- error_code: 200
=== TEST 11: print warning on duplicate service hosts
=== TEST 10: print warning on duplicate service hosts
So when booting it can be immediately known that some of them won't work.
--- http_config
lua_package_path "$TEST_NGINX_LUA_PATH";
Expand All @@ -416,7 +416,7 @@ all ok
--- grep_error_log_out
host foo for service 2 already defined by service 1
=== TEST 12: print message that service was added to the configuration
=== TEST 11: print message that service was added to the configuration
Including it's host so it is easy to see that configuration was loaded.
--- http_config
lua_package_path "$TEST_NGINX_LUA_PATH";
Expand All @@ -442,7 +442,7 @@ all ok
added service 1 configuration with hosts: foo, bar
added service 2 configuration with hosts: baz, daz
=== TEST 13: return headers with debugging info
=== TEST 12: return headers with debugging info
When X-3scale-Debug header has value of the backend authentication.
--- http_config
include $TEST_NGINX_UPSTREAM_CONFIG;
Expand Down Expand Up @@ -488,7 +488,7 @@ all ok
X-3scale-matched-rules: /
X-3scale-usage: usage%5Bhits%5D=2
=== TEST 14: uses endpoint host as Host header
=== TEST 13: uses endpoint host as Host header
when connecting to the backend
--- main_config
env RESOLVER=127.0.0.1:1953;
Expand Down Expand Up @@ -544,7 +544,7 @@ $::dns->("localhost.example.com", "127.0.0.1")
--- no_error_log
[error]
=== TEST 15: invalid service
=== TEST 14: invalid service
The message is configurable and default status is 403.
--- http_config
lua_package_path "$TEST_NGINX_LUA_PATH";
Expand Down
2 changes: 1 addition & 1 deletion t/008-apicast-request-logs.t
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ api response
--- grep_error_log_out
=== TEST 3: response codes are sent when opt-in
=== TEST 2: response codes are sent when opt-in
--- main_config
env APICAST_RESPONSE_CODES=1;
--- http_config
Expand Down
6 changes: 3 additions & 3 deletions t/009-apicast-caching.t
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ run_tests();

__DATA__

=== TEST 5: call to backend is cached
=== TEST 1: call to backend is cached
First call is done synchronously and the second out of band.
--- http_config
include $TEST_NGINX_UPSTREAM_CONFIG;
Expand Down Expand Up @@ -74,7 +74,7 @@ apicast cache miss key: 42:value:usage%5Bhits%5D=2
apicast cache write key: 42:value:usage%5Bhits%5D=2
apicast cache hit key: 42:value:usage%5Bhits%5D=2

=== TEST 6: multi service configuration
=== TEST 2: multi service configuration
Two services can exist together and are split by their hostname.
--- http_config
include $TEST_NGINX_UPSTREAM_CONFIG;
Expand Down Expand Up @@ -161,7 +161,7 @@ apicast cache write key: 1:one-key:usage%5Bhits%5D=1
apicast cache miss key: 2:two-id:two-key:usage%5Bhits%5D=2
apicast cache write key: 2:two-id:two-key:usage%5Bhits%5D=2

=== TEST 7: call to backend is cached
=== TEST 3: call to backend is cached
First call is done synchronously and the second out of band.
--- http_config
include $TEST_NGINX_UPSTREAM_CONFIG;
Expand Down
2 changes: 1 addition & 1 deletion t/010-apicast-mapping-rules.t
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ run_tests();

__DATA__
=== TEST 5: call to backend is cached
=== TEST 1: call to backend is cached
First call is done synchronously and the second out of band.
--- http_config
include $TEST_NGINX_UPSTREAM_CONFIG;
Expand Down

0 comments on commit c0b5f28

Please sign in to comment.