Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"service": "apisix",
"workspaceFolder": "/workspace",
"privileged": true,
"postCreateCommand": "bash -c 'cd /workspace && rm -rf test-nginx && git config --global --add safe.directory /workspace && git submodule update --init --recursive && git clone https://github.com/openresty/test-nginx.git --depth 1 --single-branch -b master && make deps'",
"postCreateCommand": "bash -c 'cd /workspace && rm -rf test-nginx && git config --global --add safe.directory /workspace && git submodule update --init --recursive && git clone --depth 1 --no-checkout https://github.com/openresty/test-nginx.git test-nginx && git -C test-nginx fetch --depth 1 origin ced30a31bafab6c68873efb17b6d80f39bcd95f5 && git -C test-nginx checkout --detach FETCH_HEAD && make deps'",
"customizations": {
"vscode": {
"extensions": ["ms-vscode.makefile-tools", "ms-azuretools.vscode-docker", "sumneko.lua"]
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -439,10 +439,11 @@ uninstall:

### test : Run the test case
.PHONY: test
test: TEST_NGINX_LIB := $(if $(wildcard test-nginx/lib/Test/Nginx/Socket.pm),test-nginx/lib,../test-nginx/lib)
test: runtime
@$(call func_echo_status, "$@ -> [ Start ]")
$(ENV_GIT) submodule update --init --recursive
prove -I../test-nginx/lib -I./ -r -s t/
prove -I"$(TEST_NGINX_LIB)" -I./ -r -s t/
@$(call func_echo_success_status, "$@ -> [ Done ]")


Expand Down
5 changes: 4 additions & 1 deletion docs/en/latest/internal/testing-framework.md
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,10 @@ Note that before adding new methods to `t/lib/server.lua`, make sure that you ca

Assume your current work directory is the root of the apisix source code.

1. Git clone the latest [test-nginx](https://github.com/openresty/test-nginx) to `../test-nginx`.
1. Clone [Test::Nginx](https://github.com/openresty/test-nginx) to `../test-nginx` and check
out the revision pinned in the [Linux OpenResty CI runner](https://github.com/apache/apisix/blob/master/ci/linux_openresty_common_runner.sh).
The Dev Container checks out this revision to `test-nginx` inside the APISIX checkout.
The latest Test::Nginx can generate duplicate `http2` directives for APISIX tests that use `--- http2`.
2. Run the test: `prove -I. -I../test-nginx/inc -I../test-nginx/lib -r t/path/to/file.t`.

## Tips
Expand Down
Loading