Skip to content

Local run postgres tests

Timofey Koolin edited this page Feb 8, 2024 · 2 revisions

How to run PostgreSQL compatibility tests locally

Repository for tests: https://github.com/ydb-platform/postgres-compatibility-tests

Download repository

cd ~
git clone https://github.com/ydb-platform/postgres-compatibility-tests.git

Update repository

cd ~/postgres-compatibility-tests
git pull 

Build local YDB

cd ~/ydbwork/ydb
./ya make  ./ydb/apps/ydbd ./ydb/public/tools/local_ydb

Start local YDB

mkdir ~/kistore
cd ~/ydbwork/ydb
export YDB_EXPERIMENTAL_PG=1
./ydb/public/tools/local_ydb/local_ydb deploy --fixed-ports --ydb-working-dir ~/kistore --ydb-binary-path ./ydb/apps/ydbd/ydbd

Stop local YDB

cd ~/ydbwork/ydb
./ydb/public/tools/local_ydb/local_ydb cleanup --ydb-working-dir ~/kistore --ydb-binary-path ./ydb/apps/ydbd/ydbd

Run all tests (Go libpq)

cd ~/postgres-compatibility-tests
YDB_PG_USER=root YDB_PG_PASSWORD=1234 YDB_PG_HOST=localhost languages/go/libpq/run-test.bash
vim languages/go/libpq/test-result/raw/result.xml

Run specific test (Go libpq)

cd ~/postgres-compatibility-tests
YDB_PG_USER=root YDB_PG_PASSWORD=1234 YDB_PG_TESTNAME=Test64BitErrorChecking YDB_PG_HOST=localhost languages/go/libpq/run-test.bash
vim languages/go/libpq/test-result/raw/result.xml