diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index b4b3197e..2281a25d 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -7,7 +7,7 @@ on: branches: [ master ] env: - BRANCH_NAME: ${{ github.head_ref || github.ref_name }} + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} jobs: build: @@ -17,19 +17,21 @@ jobs: steps: - name: pg run: | + sudo apt install libipc-run-perl echo "Deploying to production server on branch" $BRANCH_NAME git config --global user.email "ci@postgrespro.ru" git config --global user.name "CI PgPro admin" + export COPT=-Werror git clone https://github.com/postgres/postgres.git pg cd pg git checkout master - ./configure --prefix=`pwd`/tmp_install CFLAGS="-O3" + ./configure --prefix=`pwd`/tmp_install CFLAGS="-O3" --enable-tap-tests --enable-cassert git clone https://github.com/postgrespro/aqo.git contrib/aqo git -C contrib/aqo checkout $BRANCH_NAME patch -p1 --no-backup-if-mismatch < contrib/aqo/aqo_master.patch make -j4 > /dev/null && make -j4 -C contrib > /dev/null env CLIENTS=50 THREADS=50 make -C contrib/aqo check - + echo "Use AQO with debug code included" git clean -fdx git -C contrib/aqo clean -fdx diff --git a/Makefile b/Makefile index 3cdf520d..b07d7f86 100755 --- a/Makefile +++ b/Makefile @@ -11,26 +11,10 @@ OBJS = $(WIN32RES) \ TAP_TESTS = 1 -REGRESS = aqo_disabled \ - aqo_controlled \ - aqo_intelligent \ - aqo_forced \ - aqo_learn \ - schema \ - aqo_fdw \ - aqo_CVE-2020-14350 \ - gucs \ - forced_stat_collection \ - unsupported \ - clean_aqo_data \ - parallel_workers \ - plancache \ - statement_timeout \ - temp_tables \ - top_queries \ - relocatable\ - look_a_like \ - feature_subspace +# Use an empty dummy test to define the variable REGRESS and therefore run all +# regression tests. regress_schedule contains the full list of real tests. +REGRESS = aqo_dummy_test +REGRESS_OPTS = --schedule=$(srcdir)/regress_schedule fdw_srcdir = $(top_srcdir)/contrib/postgres_fdw stat_srcdir = $(top_srcdir)/contrib/pg_stat_statements diff --git a/auto_tuning.c b/auto_tuning.c index abb38a92..dfe95e67 100644 --- a/auto_tuning.c +++ b/auto_tuning.c @@ -33,6 +33,12 @@ static bool is_stable(double *elems, int nelems); static bool converged_cq(double *elems, int nelems); static bool is_in_infinite_loop_cq(double *elems, int nelems); +static bool +not_used_function(int parameter) +{ + return parameter % 2; +} + /* * Returns mean value of the array of doubles. diff --git a/expected/aqo_dummy_test.out b/expected/aqo_dummy_test.out new file mode 100644 index 00000000..e69de29b diff --git a/regress_schedule b/regress_schedule new file mode 100644 index 00000000..418e14ec --- /dev/null +++ b/regress_schedule @@ -0,0 +1,22 @@ +test: aqo_disabled +test: aqo_controlled +test: aqo_intelligent +test: aqo_forced +test: aqo_learn +test: schema +test: aqo_fdw +test: aqo_CVE-2020-14350 +test: gucs +test: forced_stat_collection +test: unsupported +test: clean_aqo_data +test: parallel_workers +test: plancache +# Performance-dependent test. Can be ignored if executes in containers or on slow machines +ignore: statement_timeout +test: statement_timeout +test: temp_tables +test: top_queries +test: relocatable +test: look_a_like +test: feature_subspace diff --git a/sql/aqo_dummy_test.sql b/sql/aqo_dummy_test.sql new file mode 100644 index 00000000..e69de29b diff --git a/t/001_pgbench.pl b/t/001_pgbench.pl index 893f58db..122fd911 100644 --- a/t/001_pgbench.pl +++ b/t/001_pgbench.pl @@ -336,7 +336,7 @@ "SELECT sum(executions_with_aqo) FROM test.aqo_query_stat"); # 25 trans * 10 clients * 4 query classes = 1000 + unique SELECT to pgbench_branches -is($res, 1001, 'Each query should be logged in LEARN mode'); +is($res, $ENV{CLIENTS}*100+1, 'Each query should be logged in LEARN mode'); $res = $node->safe_psql('postgres', "SELECT sum(executions_without_aqo) FROM test.aqo_query_stat"); is($res, 0, 'AQO has learned on the queries - 2');