This is an automated email from the ASF dual-hosted git repository. membphis pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git
The following commit(s) were added to refs/heads/master by this push: new a4abbd1 doc: add unit test troubleshoot doc. (#1254) a4abbd1 is described below commit a4abbd1f3dfe2c3eea86e897aa760159864dda46 Author: Ayeshmantha Perera <akayeshman...@apache.org> AuthorDate: Sun Mar 15 01:09:23 2020 +0100 doc: add unit test troubleshoot doc. (#1254) --- doc/how-to-build-cn.md | 9 ++++++++- doc/how-to-build.md | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/doc/how-to-build-cn.md b/doc/how-to-build-cn.md index d1d8c2d..a6f1fdc 100644 --- a/doc/how-to-build-cn.md +++ b/doc/how-to-build-cn.md @@ -107,9 +107,16 @@ Makefile rules: 3. 然后 clone 最新的源码:`git clone https://github.com/openresty/test-nginx.git` 4. 通过 perl 的 `prove` 命令来加载 test-nginx 的库,并运行 `/t` 目录下的测试案例集: * 追加当前目录到perl模块目录: `export PERL5LIB=.:$PERL5LIB` - * 直接运行:`prove -Itest-nginx/lib -r t` + * 直接运行:`make test` * 指定 nginx 二进制路径:`TEST_NGINX_BINARY=/usr/local/bin/openresty prove -Itest-nginx/lib -r t` +##### 疑难排解 + +如果遇到问题 `Error unknown directive "lua_package_path" in /API_ASPIX/incubator-apisix/t/servroot/conf/nginx.conf` +确保将openresty设置为默认的nginx并按如下所示导出路径。 + + * export PATH=/usr/local/openresty/nginx/sbin:$PATH + ## 5. 更新 Admin API 的 token ,保护 Apache APISIX 修改 `conf/config.yaml` 中的 `apisix.admin_key` 并重启服务。例如下面例子: diff --git a/doc/how-to-build.md b/doc/how-to-build.md index 2ded975..22cad28 100644 --- a/doc/how-to-build.md +++ b/doc/how-to-build.md @@ -109,9 +109,16 @@ Makefile rules: 3. Clone source code:`git clone https://github.com/openresty/test-nginx.git`; 4. Load the `test-nginx` library with perl's `prove` command and run the test cases in the `/t` directory: * Set PERL5LIB for perl module: `export PERL5LIB=.:$PERL5LIB` - * Run the test cases: `prove -Itest-nginx/lib -r t` + * Run the test cases: `make test` * To set the path of nginx to run the test cases: `TEST_NGINX_BINARY=/usr/local/bin/openresty prove -Itest-nginx/lib -r t` +##### Troubleshoot + +If you run in to an issue `Error unknown directive "lua_package_path" in /API_ASPIX/incubator-apisix/t/servroot/conf/nginx.conf` +make sure to set openresty as default nginx. And export the path as below. + + * export PATH=/usr/local/openresty/nginx/sbin:$PATH + ## 5. Update Admin API token to protect Apache APISIX Changes the `apisix.admin_key` in the file `conf/config.yaml` and restart the service.