Integration tests for IoTDB are in this module.
Now integration testing supports four kinds of architecture.
Simple
: A cluster with 1 config node and 1 data node running tree model ITs.Cluster1
: A cluster with 1 config node and 3 data nodes running tree model ITs.TABLE_SIMPLE
: A cluster with 1 config node and 1 data node running table model ITs.TABLE_CLUSTER1
: A cluster with 1 config node and 3 data nodes running table model ITs.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 -P with-integration-tests
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 -P with-integration-tests
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 for tree model ITs. 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 -P with-integration-tests
You can run the integration test in Simple
mode for table model ITs.
The maven command is:
mvn clean verify -DskipUTs -pl integration-test -am -PTableSimpleIT -P with-integration-tests
You can run the integration test in 'real' cluster mode for table model ITs. 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 -PTableClusterIT -P with-integration-tests
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 -P with-integration-tests
Step 1. Run(Menu) -> Edit Configurations...
Step 2. Add New Configuration -> JUnit
Step 3. Input some fields as the following picture
Profiles
folderwith-integration-tests
profileThe maven command is:
mvn spotless::apply -P with-integration-tests
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。