File tree Expand file tree Collapse file tree 4 files changed +64
-2
lines changed Expand file tree Collapse file tree 4 files changed +64
-2
lines changed Original file line number Diff line number Diff line change @@ -20,12 +20,14 @@ test-busted:
20
20
-v ${ROOT_DIR} /plugins:/bkgateway/apisix/plugins \
21
21
apisix-test-busted " /run-test-busted.sh"
22
22
23
+ # make test-nginx
24
+ # make test-nginx CASE_FILE=bk-traffic-label.t
23
25
.PHONY : test-nginx
24
26
test-nginx :
25
27
@docker run --rm ${RUN_WITH_IT} \
26
28
-v ${ROOT_DIR} /t:/bkgateway/t/ \
27
29
-v ${ROOT_DIR} /plugins:/bkgateway/apisix/plugins \
28
- apisix-test-nginx " /run-test-nginx.sh"
30
+ apisix-test-nginx " /run-test-nginx.sh" $( if $( CASE_FILE ) , $( CASE_FILE ) )
29
31
30
32
.PHONY : apisix-test-images
31
33
apisix-test-images : apisix-test-busted apisix-test-nginx
Original file line number Diff line number Diff line change @@ -71,5 +71,10 @@ export OPENRESTY_PREFIX="/usr/local/openresty-debug"
71
71
export APISIX_MAIN=" https://raw.githubusercontent.com/apache/incubator-apisix/master/rockspec/apisix-master-0.rockspec"
72
72
export PATH=$OPENRESTY_PREFIX /nginx/sbin:$OPENRESTY_PREFIX /luajit/bin:$OPENRESTY_PREFIX /bin:$PATH
73
73
74
- FLUSH_ETCD=1 prove --timer -Itest-nginx/lib -I./ t/bk-* .t
74
+ if [ -n " $1 " ]; then
75
+ CASE_FILE=$1
76
+ FLUSH_ETCD=1 prove --timer -Itest-nginx/lib -I./ t/bk-00.t t/$CASE_FILE
77
+ else
78
+ FLUSH_ETCD=1 prove --timer -Itest-nginx/lib -I./ t/bk-* .t
79
+ fi
75
80
Original file line number Diff line number Diff line change
1
+ #
2
+ # TencentBlueKing is pleased to support the open source community by making
3
+ # 蓝鲸智云 - API 网关(BlueKing - APIGateway) available.
4
+ # Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.
5
+ # Licensed under the MIT License (the "License"); you may not use this file except
6
+ # in compliance with the License. You may obtain a copy of the License at
7
+ #
8
+ # http://opensource.org/licenses/MIT
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software distributed under
11
+ # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
12
+ # either express or implied. See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+ #
15
+ # We undertake not to change the open source license (MIT license) applicable
16
+ # to the current version of the project delivered to anyone in the future.
17
+ #
18
+
19
+ # NOTE: this file should be ran as the first test file
20
+ # otherwise other test files would fail
21
+
22
+ use t::APISIX ' no_plan' ;
23
+
24
+ repeat_each(1);
25
+ no_long_string();
26
+ no_root_location();
27
+ no_shuffle();
28
+
29
+ add_block_preprocessor(sub {
30
+ my ($block ) = @_ ;
31
+
32
+ if (!defined $block -> request) {
33
+ $block -> set_value(" request" , " GET /t" );
34
+ }
35
+ });
36
+
37
+ run_tests;
38
+
39
+ __DATA__
40
+
41
+ === TEST 1: sanity
42
+ --- config
43
+ location /t {
44
+ content_by_lua_block {
45
+ local ok = true
46
+ if not ok then
47
+ ngx.say(err)
48
+ end
49
+
50
+ ngx.say("done")
51
+ }
52
+ }
53
+ --- response_body
54
+ done
Original file line number Diff line number Diff line change 1
1
#
2
+
2
3
# TencentBlueKing is pleased to support the open source community by making
3
4
# 蓝鲸智云 - API 网关(BlueKing - APIGateway) available.
4
5
# Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.
You can’t perform that action at this time.
0 commit comments