GithubHelp home page GithubHelp logo

pg_regress_input's Introduction

pg_regress_input

input data for pg_regress test

build pg_regress

ref: https://www.postgresql.org/docs/current/install-make.html

cd postgres/
./configure
make
// after success make, pg_regress will locate at src/test/regress/pg_regress

// run pg_regress with temp started pg instance
make check

switch to stdb repo, build clapdb and start

cd stdb/build.debug

cmake .. -GNinja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=ON

ninja clap_node_inject_license parse_ddl clap_riemann_fst_builder

// init the admin user by building schema fst from `tenant.json`

cp ../tenant.json SCHEMA_ROOT/tenant.json
./riemann/cli/clap_riemann_fst_builder --target=segment --type=file
./riemann/cli/clap_riemann_fst_builder --target=schema --type=file

// start clapdb

./clap_node/clap_node --config ../stdb.toml --address 127.0.0.1 -c 4 --watch=true

// stdb.toml need enable "hardy" server for clap_node
[clap_node]
servers = ["hardy", "prometheus"]

run pg_regress on local clapdb

./postgres/src/test/regress/pg_regress --use-existing --dbname=local --host=localhost --port=8888 --schedule=parallel_schedule --user=admin.stdb --max-connections=1 --inputdir=.

input data from postgress

parallel_schedule, sql/, data/, expected/ are copied from postgres/src/test/regress/ .

parallel_schedule 里面每个 test 对应一个sql文件和预期结果: sql/xxx.sql 和 expected/xxx.out.

pg_regress 执行 sql/xxx.sql 拿到结果后和预期结果进行 diff,把diff结果输出到 regression.diffs.

$ ll postgres/src/test/regress
total 180K
drwxr-xr-x 2 longqimin longqimin 4.0K Feb 26 18:07 data/
drwxr-xr-x 2 longqimin longqimin 8.0K Feb 26 18:07 expected/
-rw-r--r-- 1 longqimin longqimin 4.4K Feb 26 18:07 GNUmakefile
-rw-r--r-- 1 longqimin longqimin  778 Feb 26 18:07 Makefile
-rw-r--r-- 1 longqimin longqimin 2.1K Feb 26 18:07 meson.build
-rw-r--r-- 1 longqimin longqimin 5.3K Feb 26 18:07 parallel_schedule
-rw-r--r-- 1 longqimin longqimin  68K Feb 26 18:07 pg_regress.c
-rw-r--r-- 1 longqimin longqimin 1.8K Feb 26 18:07 pg_regress.h
-rw-r--r-- 1 longqimin longqimin 3.1K Feb 26 18:07 pg_regress_main.c
-rw-r--r-- 1 longqimin longqimin  159 Feb 26 18:07 README
-rw-r--r-- 1 longqimin longqimin  33K Feb 26 18:07 regress.c
-rwxr-xr-x 1 longqimin longqimin 4.4K Feb 26 18:07 regressplans.sh*
-rw-r--r-- 1 longqimin longqimin  107 Feb 26 18:07 resultmap
drwxr-xr-x 2 longqimin longqimin 8.0K Feb 26 18:07 sql/

since clapdb is still in-progress and not full compatible with pg, we removed some tests to make clapdb pass.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.