From 742dea24cd1e8ab3d60ca8fa7ae53a16288db89d Mon Sep 17 00:00:00 2001 From: helmolill Date: Mon, 30 Aug 2021 14:58:20 +0300 Subject: [PATCH] Circular test --- Dockerfile | 2 +- docker-compose.yml | 8 ++ tests/circular/cf/aq_a.ini | 9 ++ tests/circular/cf/aq_c.ini | 9 ++ tests/circular/cf/bq_a.ini | 9 ++ tests/circular/cf/bq_b.ini | 9 ++ tests/circular/cf/bq_d.ini | 9 ++ tests/circular/cf/cq_b.ini | 9 ++ tests/circular/cf/cq_c.ini | 9 ++ tests/circular/cf/cq_d.ini | 9 ++ tests/circular/cf/dq_d.ini | 9 ++ tests/circular/docker_run.sh | 9 ++ tests/circular/init.sh | 14 +++ tests/circular/regen.sh | 162 +++++++++++++++++++++++++++++++++++ 14 files changed, 275 insertions(+), 1 deletion(-) create mode 100644 tests/circular/cf/aq_a.ini create mode 100644 tests/circular/cf/aq_c.ini create mode 100644 tests/circular/cf/bq_a.ini create mode 100644 tests/circular/cf/bq_b.ini create mode 100644 tests/circular/cf/bq_d.ini create mode 100644 tests/circular/cf/cq_b.ini create mode 100644 tests/circular/cf/cq_c.ini create mode 100644 tests/circular/cf/cq_d.ini create mode 100644 tests/circular/cf/dq_d.ini create mode 100755 tests/circular/docker_run.sh create mode 100755 tests/circular/init.sh create mode 100755 tests/circular/regen.sh diff --git a/Dockerfile b/Dockerfile index aff8888..5a7e8dd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM python:3.8-slim-buster WORKDIR /code COPY . . -RUN pip3 install 'psycopg2-binary==2.8.6' 'pyyaml==5.3.1' 'skytools==3.6.1' 'pgq==3.5' +RUN pip3 install 'psycopg2-binary==2.8.6' 'pyyaml==5.3.1' 'skytools==3.7.3' 'pgq==3.5.1' RUN pip3 install . ENV DEBIAN_FRONTEND="noninteractive" diff --git a/docker-compose.yml b/docker-compose.yml index 05629ad..a5a4c5a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -17,6 +17,14 @@ services: - londiste_test command: ["./simple/docker_run.sh"] + test_circular: + build: . + volumes: + - londiste_test + networks: + - londiste_test + command: ["./circular/docker_run.sh"] + networks: londiste_test: diff --git a/tests/circular/cf/aq_a.ini b/tests/circular/cf/aq_a.ini new file mode 100644 index 0000000..8dab0cb --- /dev/null +++ b/tests/circular/cf/aq_a.ini @@ -0,0 +1,9 @@ +[londiste] +job_name = aq_a +db = dbname=a +public_node_location = dbname=a +queue_name = aq +logfile = log/%(job_name)s.log +pidfile = pid/%(job_name)s.pid +pgq_autocommit = 1 +pgq_lazy_fetch = 0 diff --git a/tests/circular/cf/aq_c.ini b/tests/circular/cf/aq_c.ini new file mode 100644 index 0000000..25ddfee --- /dev/null +++ b/tests/circular/cf/aq_c.ini @@ -0,0 +1,9 @@ +[londiste] +job_name = aq_c +db = dbname=c +public_node_location = dbname=c +queue_name = aq +logfile = log/%(job_name)s.log +pidfile = pid/%(job_name)s.pid +pgq_autocommit = 1 +pgq_lazy_fetch = 0 diff --git a/tests/circular/cf/bq_a.ini b/tests/circular/cf/bq_a.ini new file mode 100644 index 0000000..78b0feb --- /dev/null +++ b/tests/circular/cf/bq_a.ini @@ -0,0 +1,9 @@ +[londiste] +job_name = bq_a +db = dbname=a +public_node_location = dbname=a +queue_name = bq +logfile = log/%(job_name)s.log +pidfile = pid/%(job_name)s.pid +pgq_autocommit = 1 +pgq_lazy_fetch = 0 diff --git a/tests/circular/cf/bq_b.ini b/tests/circular/cf/bq_b.ini new file mode 100644 index 0000000..e9e5581 --- /dev/null +++ b/tests/circular/cf/bq_b.ini @@ -0,0 +1,9 @@ +[londiste] +job_name = bq_b +db = dbname=b +public_node_location = dbname=b +queue_name = bq +logfile = log/%(job_name)s.log +pidfile = pid/%(job_name)s.pid +pgq_autocommit = 1 +pgq_lazy_fetch = 0 diff --git a/tests/circular/cf/bq_d.ini b/tests/circular/cf/bq_d.ini new file mode 100644 index 0000000..3d278dd --- /dev/null +++ b/tests/circular/cf/bq_d.ini @@ -0,0 +1,9 @@ +[londiste] +job_name = bq_d +db = dbname=d +public_node_location = dbname=d +queue_name = bq +logfile = log/%(job_name)s.log +pidfile = pid/%(job_name)s.pid +pgq_autocommit = 1 +pgq_lazy_fetch = 0 diff --git a/tests/circular/cf/cq_b.ini b/tests/circular/cf/cq_b.ini new file mode 100644 index 0000000..2673a49 --- /dev/null +++ b/tests/circular/cf/cq_b.ini @@ -0,0 +1,9 @@ +[londiste] +job_name = cq_b +db = dbname=b +public_node_location = dbname=b +queue_name = cq +logfile = log/%(job_name)s.log +pidfile = pid/%(job_name)s.pid +pgq_autocommit = 1 +pgq_lazy_fetch = 0 diff --git a/tests/circular/cf/cq_c.ini b/tests/circular/cf/cq_c.ini new file mode 100644 index 0000000..c3c7deb --- /dev/null +++ b/tests/circular/cf/cq_c.ini @@ -0,0 +1,9 @@ +[londiste] +job_name = cq_c +db = dbname=c +public_node_location = dbname=c +queue_name = cq +logfile = log/%(job_name)s.log +pidfile = pid/%(job_name)s.pid +pgq_autocommit = 1 +pgq_lazy_fetch = 0 diff --git a/tests/circular/cf/cq_d.ini b/tests/circular/cf/cq_d.ini new file mode 100644 index 0000000..b21f94c --- /dev/null +++ b/tests/circular/cf/cq_d.ini @@ -0,0 +1,9 @@ +[londiste] +job_name = cq_d +db = dbname=d +public_node_location = dbname=d +queue_name = cq +logfile = log/%(job_name)s.log +pidfile = pid/%(job_name)s.pid +pgq_autocommit = 1 +pgq_lazy_fetch = 0 diff --git a/tests/circular/cf/dq_d.ini b/tests/circular/cf/dq_d.ini new file mode 100644 index 0000000..53a9272 --- /dev/null +++ b/tests/circular/cf/dq_d.ini @@ -0,0 +1,9 @@ +[londiste] +job_name = dq_d +db = dbname=d +public_node_location = dbname=d +queue_name = dq +logfile = log/%(job_name)s.log +pidfile = pid/%(job_name)s.pid +pgq_autocommit = 1 +pgq_lazy_fetch = 0 diff --git a/tests/circular/docker_run.sh b/tests/circular/docker_run.sh new file mode 100755 index 0000000..8a2616a --- /dev/null +++ b/tests/circular/docker_run.sh @@ -0,0 +1,9 @@ +#! /bin/bash + +set -e +set -x + +cd circular + +./init.sh +./regen.sh diff --git a/tests/circular/init.sh b/tests/circular/init.sh new file mode 100755 index 0000000..8e77b26 --- /dev/null +++ b/tests/circular/init.sh @@ -0,0 +1,14 @@ +#! /bin/sh + +db_list="a b c d" + +for db in $db_list; do + echo dropdb $db + dropdb $db +done + + +for db in $db_list; do + echo createdb $db + createdb $db +done diff --git a/tests/circular/regen.sh b/tests/circular/regen.sh new file mode 100755 index 0000000..5e518ac --- /dev/null +++ b/tests/circular/regen.sh @@ -0,0 +1,162 @@ +#! /bin/bash + +. ../testlib.sh + +v='-q' +v='' +nocheck=1 + +db_list="a b c d" + +kdb_list=`echo $db_list | sed 's/ /,/g'` + +#( cd ../..; make -s install ) + +do_check() { + test $nocheck = 1 || ../zcheck.sh +} + +title Circular test + +# create ticker conf +cat > conf/pgqd.ini <