From d155025d9d5067c79de7cb844bb99f5ae3118a1c Mon Sep 17 00:00:00 2001 From: chenhaoran Date: Thu, 16 Jan 2025 18:32:07 +0800 Subject: [PATCH 1/5] ci:modify test readme --- tests/README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/README.md b/tests/README.md index fac0babe24..3bc57d67e3 100644 --- a/tests/README.md +++ b/tests/README.md @@ -154,7 +154,10 @@ Create a file in `tests/system-test` containing each functional directory and re ##### 2.Execute the test case +Ensure the test case execution is successful. +```bash cd tests/system-test & python3 ./test.py -f 0-others/test_case_template.py +``` ##### 3.Integrate into CI tests From 469cbcbf332b972433f544d8340b8a8c2b16160d Mon Sep 17 00:00:00 2001 From: chenhaoran Date: Thu, 16 Jan 2025 18:56:49 +0800 Subject: [PATCH 2/5] ci:modify test readme --- README.md | 5 ++-- tests/README.md | 73 +++++++++++++++++++++++-------------------------- 2 files changed, 36 insertions(+), 42 deletions(-) diff --git a/README.md b/README.md index 91232136c5..1111fc150f 100644 --- a/README.md +++ b/README.md @@ -138,8 +138,7 @@ git clone https://github.com/taosdata/TDengine.git cd TDengine ``` -> [!NOTE] -> TDengine Connectors can be found in following repositories: [JDBC Connector](https://github.com/taosdata/taos-connector-jdbc), [Go Connector](https://github.com/taosdata/driver-go), [Python Connector](https://github.com/taosdata/taos-connector-python), [Node.js Connector](https://github.com/taosdata/taos-connector-node), [C# Connector](https://github.com/taosdata/taos-connector-dotnet), [Rust Connector](https://github.com/taosdata/taos-connector-rust). +> NOTE: TDengine Connectors can be found in following repositories: [JDBC Connector](https://github.com/taosdata/taos-connector-jdbc), [Go Connector](https://github.com/taosdata/driver-go), [Python Connector](https://github.com/taosdata/taos-connector-python), [Node.js Connector](https://github.com/taosdata/taos-connector-node), [C# Connector](https://github.com/taosdata/taos-connector-dotnet), [Rust Connector](https://github.com/taosdata/taos-connector-rust). @@ -147,7 +146,7 @@ cd TDengine At the moment, TDengine server supports running on Linux/Windows/MacOS systems. Any application can also choose the RESTful interface provided by taosAdapter to connect the taosd service. TDengine supports X64/ARM64 CPU, and it will support MIPS64, Alpha64, ARM32, RISC-V and other CPU architectures in the future. Right now we don't support build with cross-compiling environment. -You can choose to install through source code, [container](https://docs.tdengine.com/get-started/docker/), [installation package](https://docs.tdengine.com/get-started/package/) or [Kubernetes](https://docs.tdengine.com/deployment/k8s/). This quick guide only applies to install from source. +You can choose to install through source code, [container](https://docs.tdengine.com/get-started/deploy-in-docker/), [installation package](https://docs.tdengine.com/get-started/deploy-from-package/) or [Kubernetes](https://docs.tdengine.com/operations-and-maintenance/deploy-your-cluster/#kubernetes-deployment). This quick guide only applies to install from source. TDengine provide a few useful tools such as taosBenchmark (was named taosdemo) and taosdump. They were part of TDengine. By default, TDengine compiling does not include taosTools. You can use `cmake .. -DBUILD_TOOLS=true` to make them be compiled with TDengine. diff --git a/tests/README.md b/tests/README.md index 3bc57d67e3..aef27c7a6e 100644 --- a/tests/README.md +++ b/tests/README.md @@ -3,13 +3,12 @@ 1. [Introduction](#1-introduction) 1. [Prerequisites](#2-prerequisites) 1. [Testing Guide](#3-testing-guide) - - [3.1 CI Test](#31-ci-test) - - [3.1.1 Unit Test](#311-unit-test) - - [3.1.2 System Test](#312-system-test) - - [3.1.3 Legacy Test](#313-legacy-test) - - [3.2 Smoke Test](#32-smoke-test) - - [3.3 Chaos Test](#33-chaos-test) - + - [3.1 Unit Test](#31-unit-test) + - [3.2 System Test](#32-system-test) + - [3.3 Legacy Test](#33-legacy-test) + - [3.4 Smoke Test](#34-smoke-test) + - [3.5 Chaos Test](#35-chaos-test) + - [3.6 CI Test](#36-ci-test) # 1. Introduction @@ -54,25 +53,7 @@ make && make install In `tests` directory, there are different types of tests for TDengine. Below is a brief introduction about how to run them and how to add new cases. - -## 3.1 CI Test - -CI testing (Continuous Integration testing), is an important practice in software development that aims to automate frequent integration of code into a shared codebase, build and test it to ensure code quality and stability. TDengine CI testing includes three part of test cases: unit test、system test and legacy test - -### How to run all CI test cases? - -If this is the first time to run all the CI test cases, it is recommended to add the test branch, please run it with following commands: - -```bash -cd tests -./run_all_ci_cases.sh -b main # on main branch -``` - -### How to add new cases? - -You can refer the below child sections to add new test cases for CI test. - -### 3.1.1 Unit Test +### 3.1 Unit Test Unit test script is the smallest testable part and developed for some function, method or class of TDengine. @@ -90,7 +71,7 @@ cd tests/unit-test/ bash test.sh -e 0 ``` -#### How to add new cases? +#### How to add new cases?
@@ -104,15 +85,15 @@ In the test directory corresponding to the target function module, create test f ##### 2. Update build configuration -Modify the CMakeLists.txt file in this directory to ensure that the new test files are properly included in the compilation process. See the source\os\test\CMakeLists.txt file for configuration examples. +Modify the CMakeLists.txt file in this directory to ensure that the new test files are properly included in the compilation process. See the `source/os/test/CMakeLists.txt` file for configuration examples. ##### 3. Compile test code -In the root directory of the project, create a compilation directory (e.g., debug), switch to the directory and run CMake commands (e.g., cmake .. -DBUILD_TEST=1) to generate a compilation file, and then run a compilation command (e.g. make) to complete the compilation of the test code. +In the root directory of the project, create a compilation directory (e.g., debug), switch to the directory and run CMake commands (e.g., `cmake .. -DBUILD_TEST=1`) to generate a compilation file, and then run a compilation command (e.g. make) to complete the compilation of the test code. ##### 4. Execute the test program -Find the executable file in the compiled directory(e.g. TDengine/debug/build/bin/) and run it. +Find the executable file in the compiled directory(e.g. `TDengine/debug/build/bin/`) and run it. ##### 5. Integrate into CI tests @@ -120,7 +101,7 @@ Use the add_test command to add new compiled test cases into CI test collection,
-## 3.1.2 System Test +## 3.2 System Test Python test script includes all of the functions of TDengine OSS, so some test case maybe fail cause the function only work for TDengine Enterprise Edition. @@ -154,10 +135,7 @@ Create a file in `tests/system-test` containing each functional directory and re ##### 2.Execute the test case -Ensure the test case execution is successful. -```bash cd tests/system-test & python3 ./test.py -f 0-others/test_case_template.py -``` ##### 3.Integrate into CI tests @@ -172,8 +150,7 @@ Edit `tests/parallel_test/cases.task` and add the testcase path and executions i - -## 3.1.3 Legacy Test +## 3.3 Legacy Test In the early stage of TDengine development, test cases are run by an internal test framework called TSIM, which is developed in C++. @@ -195,10 +172,10 @@ cd tests ### How to add new case? -> [!NOTE] +> [!NOTE] > TSIM test framwork is replaced by system test currently, suggest to add new test scripts to system test, you can refer [System Test](#312-system-test) for detail steps. -## 3.2 Smoke Test +## 3.4 Smoke Test Smoke test script is from system test and known as sanity testing to ensure that the critical functionalities of TDengine. @@ -213,7 +190,7 @@ cd /root/TDengine/packaging/smokeTest You can update python commands part of test_smoking_selfhost.sh file to add any system test case into smoke test. -## 3.3 Chaos Test +## 3.5 Chaos Test A simple tool to exercise various functions of the system in a randomized fashion, hoping to expose maximum number of problems without a pre-determined scenario. @@ -227,4 +204,22 @@ python3 auto_crash_gen.py ### How to add new case? Add a function, such as TaskCreateNewFunction, to pytest/crash_gen/crash_gen_main.py. + Integrate TaskCreateNewFunction into the balance_pickTaskType function in crash_gen_main.py. + +## 3.6 CI Test + +CI testing (Continuous Integration testing), is an important practice in software development that aims to automate frequent integration of code into a shared codebase, build and test it to ensure code quality and stability. TDengine CI testing includes three part of test cases: unit test、system test and legacy test + +### How to run all CI test cases? + +If this is the first time to run all the CI test cases, it is recommended to add the test branch, please run it with following commands: + +```bash +cd tests +./run_all_ci_cases.sh -b main # on main branch +``` + +### How to add new cases? + +You can refer the [Unit Test](#31-unit-test)、[System Test](#32-system-test) and [Legacy Test](#33-legacy-test) sections for detail steps to add new test cases for CI test. From 4f0335eb9976d5b88bbf515b7f75f924f22217ad Mon Sep 17 00:00:00 2001 From: chenhaoran Date: Thu, 16 Jan 2025 19:03:14 +0800 Subject: [PATCH 3/5] ci:modify test readme --- tests/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/README.md b/tests/README.md index aef27c7a6e..b9fa40f93b 100644 --- a/tests/README.md +++ b/tests/README.md @@ -173,7 +173,7 @@ cd tests ### How to add new case? > [!NOTE] -> TSIM test framwork is replaced by system test currently, suggest to add new test scripts to system test, you can refer [System Test](#312-system-test) for detail steps. +> TSIM test framwork is replaced by system test currently, suggest to add new test scripts to system test, you can refer [System Test](#32-system-test) for detail steps. ## 3.4 Smoke Test From 0af9f1005435f003606914d62e560e0836a370ba Mon Sep 17 00:00:00 2001 From: chenhaoran Date: Thu, 16 Jan 2025 19:10:10 +0800 Subject: [PATCH 4/5] Merge latest changes from origin/docs/chr1-readme --- tests/README.md | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tests/README.md b/tests/README.md index b9fa40f93b..bc97d74afd 100644 --- a/tests/README.md +++ b/tests/README.md @@ -12,7 +12,9 @@ # 1. Introduction -This manual is intended to provide users with comprehensive guidance to help them verify the TDengine function efficiently. The document is divided into three main sections: introduction, prerequisites and testing guide. +This manual is intended to provide users with comprehensive guidance to help them verify the TDengine function efficiently. + +The document is divided into three main sections: introduction, prerequisites and testing guide. > [!NOTE] > The below commands and test scripts are verified on linux (Ubuntu 18.04、20.04、22.04) locally. @@ -89,7 +91,9 @@ Modify the CMakeLists.txt file in this directory to ensure that the new test fil ##### 3. Compile test code -In the root directory of the project, create a compilation directory (e.g., debug), switch to the directory and run CMake commands (e.g., `cmake .. -DBUILD_TEST=1`) to generate a compilation file, and then run a compilation command (e.g. make) to complete the compilation of the test code. +In the root directory of the project, create a compilation directory (e.g., debug), switch to the directory and run CMake commands (e.g., `cmake .. -DBUILD_TEST=1`) to generate a compilation file, + +and then run a compilation command (e.g. make) to complete the compilation of the test code. ##### 4. Execute the test program @@ -110,7 +114,7 @@ work for TDengine Enterprise Edition. ```bash cd tests/system-test -python3 ./test.py -f 2-query/floor.py +python3 ./test.py -f 2-query/avg.py ``` ### How to run all system test cases? @@ -127,6 +131,7 @@ cd tests Detailed steps to add new system test case The Python test framework is developed by TDengine teams, and test.py is the test case execution and monitoring of the entry program, Use `python3 ./test.py -h` to view more features. + you can refer below steps to add one test case: ##### 1.Create a test case file and develop the test cases @@ -209,7 +214,9 @@ Integrate TaskCreateNewFunction into the balance_pickTaskType function in crash_ ## 3.6 CI Test -CI testing (Continuous Integration testing), is an important practice in software development that aims to automate frequent integration of code into a shared codebase, build and test it to ensure code quality and stability. TDengine CI testing includes three part of test cases: unit test、system test and legacy test +CI testing (Continuous Integration testing), is an important practice in software development that aims to automate frequent integration of code into a shared codebase, build and test it to ensure code quality and stability. + +TDengine CI testing includes three part of test cases: unit test、system test and legacy test ### How to run all CI test cases? From 35f8fb8153f615d71cb2277d381ab75ea57464d9 Mon Sep 17 00:00:00 2001 From: chenhaoran Date: Thu, 16 Jan 2025 19:11:36 +0800 Subject: [PATCH 5/5] ci:modify test readme --- tests/README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/README.md b/tests/README.md index bc97d74afd..5574a16743 100644 --- a/tests/README.md +++ b/tests/README.md @@ -140,7 +140,10 @@ Create a file in `tests/system-test` containing each functional directory and re ##### 2.Execute the test case +Ensure the test case execution is successful. +``` bash cd tests/system-test & python3 ./test.py -f 0-others/test_case_template.py +``` ##### 3.Integrate into CI tests