mirror of
https://github.com/maplibre/martin.git
synced 2024-12-24 23:45:42 +03:00
555a1fccdd
* added manual coverage justfile command * a lot of small refactorings of config and argument parsing * feature: support jsonb query param for functions * cleaned up public/private access * make all tests populate with a predefined values to avoid issues with random data
33 lines
1.5 KiB
Bash
Executable File
33 lines
1.5 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
FIXTURES_DIR="$(dirname "$0")"
|
|
echo -e "\n\n\n"
|
|
echo "################################################################################################"
|
|
echo "Loading Martin test fixtures into '$PGDATABASE' as user '$PGUSER'"
|
|
echo "################################################################################################"
|
|
|
|
|
|
psql -P pager=off -v ON_ERROR_STOP=1 -c "CREATE EXTENSION IF NOT EXISTS postgis;"
|
|
# see https://github.com/postgis/docker-postgis/issues/187
|
|
psql -P pager=off -v ON_ERROR_STOP=1 -c "DROP SCHEMA IF EXISTS tiger CASCADE;"
|
|
psql -P pager=off -v ON_ERROR_STOP=1 -t -c "select version();"
|
|
psql -P pager=off -v ON_ERROR_STOP=1 -t -c "select PostGIS_Full_Version();"
|
|
|
|
|
|
echo -e "\n\n\n"
|
|
echo "################################################################################################"
|
|
echo "Importing tables from $FIXTURES_DIR/tables"
|
|
echo "################################################################################################"
|
|
for sql_file in "$FIXTURES_DIR"/tables/*.sql; do
|
|
psql -e -P pager=off -v ON_ERROR_STOP=1 -f "$sql_file"
|
|
done
|
|
|
|
echo -e "\n\n\n"
|
|
echo "################################################################################################"
|
|
echo "Importing functions from $FIXTURES_DIR/functions"
|
|
echo "################################################################################################"
|
|
for sql_file in "$FIXTURES_DIR"/functions/*.sql; do
|
|
psql -e -P pager=off -v ON_ERROR_STOP=1 -f "$sql_file"
|
|
done
|