diff --git a/test/README.md b/test/README.md index 1a152fb40..d5fb6b86c 100644 --- a/test/README.md +++ b/test/README.md @@ -19,6 +19,7 @@ Higress provides make target to run ingress api conformance tests and wasmplugin + API Tests: `make ingress-conformance-test` + WasmPlugin Tests: `make ingress-wasmplugin-test` + + Only build one WasmPlugin for testing: `PLUGIN_NAME=request-block make ingress-wasmplugin-test` It can be divided into below steps: diff --git a/tools/hack/build-wasm-plugins.sh b/tools/hack/build-wasm-plugins.sh index 088574493..4a9074ea5 100755 --- a/tools/hack/build-wasm-plugins.sh +++ b/tools/hack/build-wasm-plugins.sh @@ -18,6 +18,19 @@ set -euo pipefail cd ./plugins/wasm-go/ -# developer need to declear new wasmplugins here for test -PLUGIN_NAME=http-call make build -PLUGIN_NAME=request-block make build \ No newline at end of file +INNER_PLUGIN_NAME=${PLUGIN_NAME-""} +if [ ! -n "$INNER_PLUGIN_NAME" ]; then + EXTENSIONS_DIR=$(pwd)"/extensions/" + echo "build all wasmplugins under folder of $EXTENSIONS_DIR" + for file in `ls $EXTENSIONS_DIR` + do + if [ -d $EXTENSIONS_DIR$file ]; then + name=${file##*/} + echo "build wasmplugin name of $name" + PLUGIN_NAME=${name} make build + fi + done +else + echo "build wasmplugin name of $INNER_PLUGIN_NAME" + PLUGIN_NAME=${INNER_PLUGIN_NAME} make build +fi