Integration tests for IoTDB are in this module.
Now integration testing supports two kinds of architecture.
Simple
: A cluster with 1 config node and 1 data node.Cluster1
: A cluster with 1 config node and 3 data nodes.Integration testing in Simple
mode can be run with both maven and IDEs like IntelliJ easily.
The maven command is:
mvn clean verify -DskipUTs -pl integration-test -am
Notice that, this above maven command only run IT.
And if you want to run IT in the IDE like IntelliJ, when you run the test for the first time, or when you change the code of the module that the integration test module depends on, you may need to use the following command to generate integration-test/target/template-node
for the node to be tested.
mvn clean package -DskipTests -pl integration-test -am
After doing this, you can run any one just by clicking the test case and pressing Run
, like running normal cases :).
You can run the integration test in a ‘real’ cluster mode. At present, we have implemented a pseudo cluster with 1 config nodes and 3 data nodes. (As the test cases and the test environment are decoupled, we can easily implement other pseudo cluster or even a docker-based cluster later.)
The maven command is:
mvn clean verify -DskipUTs -pl integration-test -am -PClusterIT
If you want to run IT in Cluster1
mode in the IDE like IntelliJ, you need to achieve the effect as the ClusterIT
profile in maven explicitly. Follow Steps 1-4 to achieve it.
Step 0. Optionally, when you run the test for the first time, or when you change the code of the module that the integration test module depends on, you may need to use the following command to generate integration-test/target/template-node
for nodes of the pseudo cluster.
It has the same effect as the Simple
counterpart; these two commands' generations are the same content.
mvn clean package -DskipTests -pl integration-test
Step 1. Run(Menu) -> Edit Configurations...
Step 2. Add New Configuration -> JUnit
Step 3. Input some fields as the following picture