Files
pgcat/.circleci/run_tests.sh

42 lines
1.0 KiB
Bash
Raw Normal View History

2022-02-10 11:08:57 -08:00
#!/bin/bash
set -e
2022-02-10 11:11:56 -08:00
set -o xtrace
2022-02-10 11:08:57 -08:00
psql -e -h 127.0.0.1 -p 5432 -U postgres -f tests/sharding/query_routing_setup.sql
2022-02-10 11:08:57 -08:00
./target/debug/pgcat &
sleep 1
# Setup PgBench
pgbench -i -h 127.0.0.1 -p 6432
# Run it
2022-02-11 22:24:27 -08:00
pgbench -h 127.0.0.1 -p 6432 -t 500 -c 2 --protocol simple
2022-02-10 11:08:57 -08:00
2022-02-11 22:24:27 -08:00
# Extended protocol
pgbench -h 127.0.0.1 -p 6432 -t 500 -c 2 --protocol extended
# COPY TO STDOUT test
psql -h 127.0.0.1 -p 6432 -c 'COPY (SELECT * FROM pgbench_accounts LIMIT 15) TO STDOUT;' > /dev/null
# Query cancellation test
(psql -h 127.0.0.1 -p 6432 -c 'SELECT pg_sleep(5)' || true) &
killall psql -s SIGINT
2022-02-11 22:24:27 -08:00
# Sharding insert
2022-02-10 11:16:08 -08:00
psql -e -h 127.0.0.1 -p 6432 -f tests/sharding/query_routing_test_insert.sql
2022-02-10 11:08:57 -08:00
2022-02-11 22:24:27 -08:00
# Sharding select
2022-02-10 11:20:33 -08:00
psql -e -h 127.0.0.1 -p 6432 -f tests/sharding/query_routing_test_select.sql > /dev/null
2022-02-10 11:08:57 -08:00
2022-02-11 22:24:27 -08:00
# Replica/primary selection & more sharding tests
psql -e -h 127.0.0.1 -p 6432 -f tests/sharding/query_routing_test_primary_replica.sql > /dev/null
# Attempt clean shut down
killall pgcat -s SIGINT
# Allow for graceful shutdown
sleep 1