1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

chore: testing scripts for cockroachdb

This commit is contained in:
Ferdinand Mütsch 2023-07-08 20:33:07 +02:00
parent 5278dba4f4
commit 2af82f529a
3 changed files with 49 additions and 15 deletions

View File

@ -0,0 +1,39 @@
env: production
server:
listen_ipv4: 127.0.0.1
listen_ipv6:
tls_cert_path:
tls_key_path:
port: 3000
base_path: /
public_url: http://localhost:3000
app:
aggregation_time: '02:15'
report_time_weekly: 'fri,18:00'
heartbeat_max_age: 87600h # 10 years
inactive_days: 7
custom_languages:
vue: Vue
jsx: JSX
svelte: Svelte
db:
host: 127.0.0.1
port: 56257
user: root
password:
name: defaultdb
dialect: cockroach
charset:
max_conn: 2
ssl: false
automgirate_fail_silently: false
security:
password_salt:
insecure_cookies: true
cookie_max_age: 172800
allow_signup: true
expose_metrics: true

View File

@ -9,8 +9,6 @@ services:
POSTGRES_DB: "wakapi"
PGPORT: 55432
network_mode: host
volumes:
- wakapi-postgres:/var/lib/postgresql/data
mysql:
image: mysql:8
@ -21,8 +19,6 @@ services:
MYSQL_DATABASE: "wakapi"
MYSQL_ROOT_PASSWORD: example
network_mode: host
volumes:
- wakapi-mysql:/var/lib/mysql
mariadb:
image: mariadb:10
@ -33,10 +29,8 @@ services:
MARIADB_DATABASE: "wakapi"
MARIADB_ROOT_PASSWORD: example
network_mode: host
volumes:
- wakapi-mariadb:/var/lib/mysql
volumes:
wakapi-postgres: {}
wakapi-mysql: {}
wakapi-mariadb: {}
cockroach:
image: cockroachdb/cockroach
entrypoint: '/cockroach/cockroach start-single-node --insecure --sql-addr=:56257'
network_mode: host

View File

@ -46,9 +46,8 @@ trap cleanup EXIT
# Initialise test data
case $1 in
postgres|mysql|mariadb)
postgres|mysql|mariadb|cockroach)
docker compose -f "$script_dir/docker-compose.yml" down
docker volume rm "testing_wakapi-$1"
docker_down=1
docker compose -f "$script_dir/docker-compose.yml" up --wait -d "$1"
@ -61,8 +60,10 @@ case $1 in
db_port=0
if [ "$1" == "postgres" ]; then
db_port=55432
elif [ "$1" == "cockroach" ]; then
db_port=56257
else
db_port=53306
db_port=26257
fi
for _ in $(seq 0 30); do
@ -90,8 +91,8 @@ wait_for_wakapi () {
counter=0
echo "Waiting for Wakapi to come up ..."
until curl --output /dev/null --silent --get --fail http://localhost:3000/api/health; do
if [ "$counter" -ge 5 ]; then
echo "Waited for 5s, but Wakapi failed to come up ..."
if [ "$counter" -ge 30 ]; then
echo "Waited for 30s, but Wakapi failed to come up ..."
exit 1
fi