There are two key points:
shenyu-integrated-tests/src/test
.If you are using windows, please notice that
-
is an invalid operator for terminals.
Run those steps under this project's root directory
dist
from source, run this command under root directory:./mvnw -B clean install -Prelease,docker -Dmaven.javadoc.skip=true -Dmaven.test.skip=true
./mvnw -B clean install -Pit -DskipTests -f ./shenyu-integrated-test/pom.xml
docker-compose -f ./shenyu-integrated-test/${{ matrix.case }}/docker-compose.yml up -d
You need to replace ${{ matrix.case }} with the exact directory, such as shenyu-integrated-test-http. On mac, you could
docker compose
, but if you are using ubuntu, you'd better usingdocker-compose
.
./mvnw test -Pit -f ./shenyu-integrated-test/${{ matrix.case }}/pom.xml
That's the easy case!
You just need to do those steps:
(Optional) Update gateway configure. The configure file is under shenyu-integated-test-{plugin}/src/main/resources/application-local.yml
Writing new test cases under shenyu-integated-test-{plugin}/src/test
.
In this case, we didn't write tests for this plugin, so you need to setup the environment by yourself.
shenyu-integrated-test
The name should be shenyu-integrated-test-{plugin}
.
You should read the shenyu's documents and add dependencies to pom.xml
file.
Write Dockerfile
for this module. We will use this module‘s image to star up docker compose. In this step you could copy other plugins’ Dockerfile
and update it.
We are using shenyu-examples
module as the backend behind gateway. So you need to write Dockerfile
for your plugin's example module.
You could copy other plugins' docker-compose
file. Update the image of example‘s image and gateway’s image
Now, we can request related path in PluginController
in shenyu-web
to modify the configuration of shenyu gateway. You could extends AbstractPluginDataInit
and call method in AbstractPluginDataInit
to change the configuration in shenyu.
However, pls remember to clean after class.
Writing tests under shenyu-integated-test-{plugin}/src/test
. You must run test locally before you commit your changes.
You could copy other plugins' YAML file and then update the plugin name. And then you could make PR for us.