29 Star 199 Fork 83

Apache/IoTDB

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
.github
.idea
.mvn
code-coverage
distribution
docker
example
integration-test
src
README.md
checkstyle.xml
import-control.xml
pom.xml
iotdb-api
iotdb-client
iotdb-core
iotdb-protocol
library-udf
licenses
scripts
src/main
.asf.yaml
.checkstyle
.dockerignore
.git-blame-ignore-revs
.gitattributes
.gitignore
.gitmodules
CONTRIBUTING.md
Code Summary.md
Jenkinsfile
LICENSE
LICENSE-binary
NOTICE
NOTICE-binary
README.md
README_ZH.md
RELEASE_NOTES.md
asf.header
checkstyle.xml
codecov.yml
dependencies.json
iotdb-doap.rdf
java-google-style.xml
jenkins.pom
mvnw
mvnw.cmd
pom.xml
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

Integration Test User Guide

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 with Simple Consensus Mode

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 .

Simple Run

Integration Testing with Cluster Mode

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...
    Run(Menu)

  • Step 2. Add New Configuration -> JUnit
    Add New Configuration

  • Step 3. Input some fields as the following picture
    ClusterIT Category

Let IDEA recognize integration test module

  • Step 1. Open the Maven tab onn the right side of the IDEA window.
  • Step 2. Open Profiles folder
  • Step 3. Select with-integration-tests profile

Format code style of integration test

The maven command is:

mvn spotless::apply -P with-integration-tests 
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/apache/iotdb.git
git@gitee.com:apache/iotdb.git
apache
iotdb
IoTDB
master

搜索帮助