aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBulat Gayazov <brgayazov@yandex-team.ru>2023-06-29 09:17:27 +0000
committerbrgayazov <bulat@ydb.tech>2023-06-29 12:17:27 +0300
commit0088b8b48f22725562d77695ef1c9603ac427c17 (patch)
treedf0b5085126345255c3e78380294c4c6cdcbc469
parentde77c1ac2d47b8ba61b738300b347584bb382b0e (diff)
downloadydb-0088b8b48f22725562d77695ef1c9603ac427c17.tar.gz
Added instructions how to build and run YDB CLI tests
Added instructions how to build and run YDB CLI tests Pull Request resolved: #274
-rw-r--r--BUILD.md33
-rw-r--r--ydb/tests/functional/README.md18
2 files changed, 38 insertions, 13 deletions
diff --git a/BUILD.md b/BUILD.md
index 0452ac2c31..066a8b410f 100644
--- a/BUILD.md
+++ b/BUILD.md
@@ -140,22 +140,43 @@ With enabled Ccache, you can finish the compilation of all targets on supported
## Build
-To build both YDB server (ydbd) and YDB CLI (ydb) run:
+To build all binary artifacts (server YDBD, client YDB, unittest binaries) run:
```bash
ninja
```
-To build only YDB CLI (ydb) run:
-```bash
-ninja ydb/apps/ydb/all
-```
-
A YDB server binary can be found at:
```
ydb/apps/ydbd/ydbd
```
+
+## Build and Test YDB CLI
+
+To build YDB CLI (ydb):
+```bash
+ninja ydb/apps/ydb/all
+```
+
A YDB CLI binary can be found at:
```
ydb/apps/ydb/ydb
```
+### Unit tests
+
+To build YDB CLI unit tests:
+```bash
+ninja ydb/public/lib/ydb_cli/all
+```
+
+To run tests execute:
+```bash
+cd ydb/public/lib/ydb_cli/
+ctest
+```
+
+### Functional tests
+
+Before launch tests you need to build YDB CLI and YDB server binaries.
+Also you can load [ydbd](https://ydb.tech/en/docs/downloads/#ydb-server) binary file and use it.
+To launch YDB CLI python tests run `ydb_cli` test suite via pytest according to this [instruction](ydb/tests/functional/README.md).
diff --git a/ydb/tests/functional/README.md b/ydb/tests/functional/README.md
index d33bd6a06e..92bff0e603 100644
--- a/ydb/tests/functional/README.md
+++ b/ydb/tests/functional/README.md
@@ -6,7 +6,7 @@ YDB function tests can be run via pytest. To launch them, complete the following
1. Build YDB. You can use [this guide](https://github.com/ydb-platform/ydb/blob/main/BUILD.md).
2. Install `grpc-tools` package. You can use [this guide](https://grpc.io/docs/languages/python/quickstart).
3. Install some more packages:
- ```
+ ```bash
pip install PyHamcrest
pip install tornado
pip install xmltodict
@@ -14,27 +14,31 @@ YDB function tests can be run via pytest. To launch them, complete the following
4. Initialize the following enviroment variables:
- `source_root` should match the root of YDB GitHub repo. If you did not change any of the commands from YDB
build guide, then you should export the variable via
- ```
+ ```bash
export source_root=~/ydbwork/ydb
```
- `build_root` should match the directory, where YDB was built. If you did not change any of the commands from YDB
build guide, then you should export the variable via
- ```
+ ```bash
export build_root=~/ydbwork/build
```
5. Launch the script, which prepares the environment:
- ```
+ ```bash
source ${source_root}/ydb/tests/oss/launch/prepare.sh
```
Not that this script sets environment variables, so you need to re-run it, if terminal session is ended.
-7. Launch tests:
+6. (Optional) Specify own YDBD binary file to use:
+ ```bash
+ export YDB_DRIVER_BINARY="path/to/ydbd/binary"
```
+7. Launch tests:
+ ```bash
python ${source_root}/ydb/tests/oss/launch/launch.py --test-dir ${source_root}/ydb/tests/functional --xml-dir ${source_root}/ydb/tests/functional/test-results/xml
```
Note that you can also run a specific suite via `--suite` argument.
Alternatively, you can `cd` to `${source_root}/ydb/tests/functional` and invoke native `pytest`.
-6. The script runs the tests. After that, you can see test report:
- ```
+8. The script runs the tests. After that, you can see test report:
+ ```bash
cat ${source_root}/ydb/tests/functional/test-results/xml/res.xml
```