mirror of
https://github.com/postgresml/pgcat.git
synced 2026-03-26 10:26:30 +00:00
@@ -10,18 +10,31 @@ jobs:
|
|||||||
# See: https://circleci.com/docs/2.0/configuration-reference/#docker-machine-macos-windows-executor
|
# See: https://circleci.com/docs/2.0/configuration-reference/#docker-machine-macos-windows-executor
|
||||||
docker:
|
docker:
|
||||||
- image: cimg/rust:1.58.1
|
- image: cimg/rust:1.58.1
|
||||||
|
- image: cimg/postgres:14.0
|
||||||
|
auth:
|
||||||
|
username: mydockerhub-user
|
||||||
|
password: $DOCKERHUB_PASSWORD
|
||||||
|
environment:
|
||||||
|
POSTGRES_USER: postgres
|
||||||
|
POSTGRES_DB: postgres
|
||||||
# Add steps to the job
|
# Add steps to the job
|
||||||
# See: https://circleci.com/docs/2.0/configuration-reference/#steps
|
# See: https://circleci.com/docs/2.0/configuration-reference/#steps
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
key: cargo-lock-2-{{ checksum "Cargo.lock" }}
|
key: cargo-lock-2-{{ checksum "Cargo.lock" }}
|
||||||
|
- run:
|
||||||
|
name: "Install dependencies"
|
||||||
|
command: "sudo apt-get update && sudo apt-get install -y postgresql-contrib-12 postgresql-client-12"
|
||||||
- run:
|
- run:
|
||||||
name: "Build"
|
name: "Build"
|
||||||
command: "cargo build"
|
command: "cargo build"
|
||||||
- run:
|
- run:
|
||||||
name: "Test"
|
name: "Test"
|
||||||
command: "cargo test"
|
command: "cargo test"
|
||||||
|
- run:
|
||||||
|
name: "Test end-to-end"
|
||||||
|
command: "bash .circleci/run_tests.sh"
|
||||||
- save_cache:
|
- save_cache:
|
||||||
key: cargo-lock-2-{{ checksum "Cargo.lock" }}
|
key: cargo-lock-2-{{ checksum "Cargo.lock" }}
|
||||||
paths:
|
paths:
|
||||||
|
|||||||
24
.circleci/run_tests.sh
Normal file
24
.circleci/run_tests.sh
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
set -o xtrace
|
||||||
|
|
||||||
|
./target/debug/pgcat &
|
||||||
|
|
||||||
|
sleep 1
|
||||||
|
|
||||||
|
psql -e -h 127.0.0.1 -p 5432 -U postgres -f tests/sharding/query_routing_setup.sql
|
||||||
|
|
||||||
|
# Setup PgBench
|
||||||
|
pgbench -i -h 127.0.0.1 -p 6432
|
||||||
|
|
||||||
|
# Run it
|
||||||
|
pgbench -h 127.0.0.1 -p 6432 -t 500 -c 2
|
||||||
|
|
||||||
|
psql -e -h 127.0.0.1 -p 6432 -f tests/sharding/query_routing_test_insert.sql
|
||||||
|
|
||||||
|
psql -e -h 127.0.0.1 -p 6432 -f tests/sharding/query_routing_test_select.sql > /dev/null
|
||||||
|
|
||||||
|
# psql -f tests/sharding/query_routing_test_validate.sql
|
||||||
|
|
||||||
|
psql -e -h 127.0.0.1 -p 6432 -f tests/sharding/query_routing_test_primary_replica.sql > /dev/null
|
||||||
Reference in New Issue
Block a user