Skip to content

Commit

Permalink
Add new script for testing derived tables
Browse files Browse the repository at this point in the history
  • Loading branch information
nassibnassar committed Feb 10, 2022
1 parent 3b254d0 commit 0ef099c
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 105 deletions.
53 changes: 0 additions & 53 deletions ci.yml

This file was deleted.

13 changes: 0 additions & 13 deletions run-ci-metadb.sh

This file was deleted.

26 changes: 0 additions & 26 deletions run-ci-transition.sh

This file was deleted.

13 changes: 0 additions & 13 deletions run-ci.sh

This file was deleted.

32 changes: 32 additions & 0 deletions testall.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash
#
# Set the following environment variables before running this script:
#
# PGDATABASE - "folio_juniper" or "folio_snapshot'
# PGUSER - database user name
#
# For example:
#
# $ cd sql_metadb/derived_tables/
# $ PGDATABASE=folio_juniper PGUSER=nrn ../../testall.sh
#
set -e
# Check that the runlist exists.
if [[ ! -f runlist.txt ]]; then
echo "testall.sh: runlist.txt not found"
exit 1
fi
# Check for duplicates in runlist.
if [[ $(sort runlist.txt | uniq -d) ]]; then
echo "testall.sh: runlist.txt contains duplicates: `sort runlist.txt | uniq -d`"
exit 1
fi
# Run all queries.
tmpfile=`mktemp --tmpdir=. testall-XXXXXXXXXX.tmp`
trap 'rm -f -- "$tmpfile"' EXIT
for f in $( cat runlist.txt ); do
if ! PGOPTIONS='--client-min-messages=warning' /usr/bin/time -o $tmpfile -f '%es' psql -h glintcore.net -c '\set ON_ERROR_STOP on' -f $f -Xq ; then
exit 1
fi
printf 'ok\t%-50s\t%s\n' $f `cat $tmpfile` 1>&2
done || exit 1
File renamed without changes.

0 comments on commit 0ef099c

Please sign in to comment.