-
Notifications
You must be signed in to change notification settings - Fork 2.6k
/
Copy pathlinux_openresty_common_runner.sh
executable file
·117 lines (90 loc) · 2.79 KB
/
linux_openresty_common_runner.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#!/usr/bin/env bash
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
. ./ci/common.sh
before_install() {
linux_get_dependencies
sudo cpanm --notest Test::Nginx >build.log 2>&1 || (cat build.log && exit 1)
}
do_install() {
export_or_prefix
./ci/linux-install-openresty.sh
./utils/linux-install-luarocks.sh
./ci/linux-install-etcd-client.sh
create_lua_deps
# sudo apt-get install tree -y
# tree deps
# The latest version of test-nginx is not compatible with the current set of tests with ---http2
# due to this commit: https://github.com/openresty/test-nginx/commit/0ccd106cbe6878318e5a591634af8f1707c411a6
# This change pins test-nginx to a commit before this one.
git clone --depth 1 https://github.com/openresty/test-nginx.git test-nginx
cd test-nginx
git fetch --depth=1 origin ced30a31bafab6c68873efb17b6d80f39bcd95f5
git checkout ced30a31bafab6c68873efb17b6d80f39bcd95f5
cd ..
make utils
mkdir -p build-cache
# install and start grpc_server_example
cd t/grpc_server_example
CGO_ENABLED=0 go build
cd ../../
# install grpcurl
install_grpcurl
# install nodejs
install_nodejs
# grpc-web server && client
cd t/plugin/grpc-web
./setup.sh
# back to home directory
cd ../../../
# install vault cli capabilities
install_vault_cli
# install brotli
install_brotli
}
script() {
export_or_prefix
openresty -V
make init
set_coredns
start_grpc_server_example
start_sse_server_example
# APISIX_ENABLE_LUACOV=1 PERL5LIB=.:$PERL5LIB prove -Itest-nginx/lib -r t
FLUSH_ETCD=1 TEST_EVENTS_MODULE=$TEST_EVENTS_MODULE prove --timer -Itest-nginx/lib -I./ -r $TEST_FILE_SUB_DIR | tee /tmp/test.result
rerun_flaky_tests /tmp/test.result
}
after_success() {
# cat luacov.stats.out
# luacov-coveralls
echo "done"
}
case_opt=$1
shift
case ${case_opt} in
before_install)
before_install "$@"
;;
do_install)
do_install "$@"
;;
script)
script "$@"
;;
after_success)
after_success "$@"
;;
esac