3. ./smoketest.sh -g \# for memory leak detection test with valgrind
# for memory leak detection test with valgrind
./smoketest.sh -g
4. ./fulltest.sh \# for full test
# for full test
./fulltest.sh
```
> Note1: TDengine daemon's configuration and data files are stored in
> Note1: TDengine daemon's configuration and data files are stored in
> \<TDengine\>/sim directory. As a historical design, it's same place with
> \<TDengine\>/sim directory. As a historical design, it's same place with
...
@@ -42,35 +60,39 @@
...
@@ -42,35 +60,39 @@
> user. You need to remove the directory completely first before running the
> user. You need to remove the directory completely first before running the
> Python test case. We should consider using two different locations to store
> Python test case. We should consider using two different locations to store
> for TSIM and Python script.
> for TSIM and Python script.
>
> Note2: if you need to debug crash problem with a core dump, you need
> Note2: if you need to debug crash problem with a core dump, you need
> manually edit smoketest.sh or fulltest.sh to add "ulimit -c unlimited"
> manually edit smoketest.sh or fulltest.sh to add "ulimit -c unlimited"
> before the script line. Then you can look for the core file in
> before the script line. Then you can look for the core file in
> \<TDengine\>/tests/pytest after the program crash.
> \<TDengine\>/tests/pytest after the program crash.
## How to add a new test case
### How to add a new test case
### 1. TSIM test cases
**1. TSIM test cases:**
TSIM was the testing framework has been used internally. Now it still be used
to run the test cases we develop in the past as a legacy system. We are
turning to use Python to develop new test case and are abandoning TSIM
gradually.
TSIM was the testing framework has been used internally. Now it still be used to run the test cases we develop in the past as a legacy system. We are turning to use Python to develop new test case and are abandoning TSIM gradually.
### 2. Python test cases
**2. Python test cases:**
#### 2.1 Add a new Python test case
**2.1 Please refer to \<TDengine\>/tests/pytest/insert/basic.py to add a new
Please refer to `TDengine/tests/pytest/insert/basic.py` to add a new
test case.** The new test case must implement 3 functions, where self.init()
test case. The new test case must implement 3 functions, where `self.init()`
and self.stop() simply copy the contents of insert/basic.py and the test
and `self.stop()` simply copy the contents of `insert/basic.py` and the test
logic is implemented in self.run(). You can refer to the code in the util
logic is implemented in `self.run()`. You can refer to the code in the `util`
directory for more information.
directory for more information.
**2.2 Edit smoketest.sh to add the path and filename of the new test case**
#### 2.2 Edit smoketest.sh to add the path and filename of the new test case
Note: The Python test framework may continue to be improved in the future,
Note: The Python test framework may continue to be improved in the future,
hopefully, to provide more functionality and ease of writing test cases. The
hopefully, to provide more functionality and ease of writing test cases. The
method of writing the test case above does not exclude that it will also be
method of writing the test case above does not exclude that it will also be
affected.
affected.
**2.3 What test.py does in detail:**
#### 2.3 What test.py does in detail
test.py is the entry program for test case execution and monitoring.
test.py is the entry program for test case execution and monitoring.
...
@@ -87,145 +109,118 @@ test.py has the following functions.
...
@@ -87,145 +109,118 @@ test.py has the following functions.
\-h--help, display help
\-h--help, display help
**2.4 What util/log.py does in detail:**
#### 2.4 What util/log.py does in detail
log.py is quite simple, the main thing is that you can print the output in
`log.py` is quite simple, the main thing is that you can print the output in
different colors as needed. The success() should be called for successful
different colors as needed. The `success()` should be called for successful
test case execution and the success() will print green text. The exit() will
test case execution and the`success()` will print green text. The `exit()` will
print red text and exit the program, exit() should be called for test
print red text and exit the program, `exit()` should be called for test