From b444f7d3b16a64526a67548d241285b68b46d7ae Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Wed, 9 Dec 2020 18:07:48 -0500 Subject: [PATCH] Adding -x to nosetests and correcting DB setup scripts --- .github/scripts/install.sh | 24 +++++------------------- .github/scripts/python-pkg-test.sh | 4 ++-- 2 files changed, 7 insertions(+), 21 deletions(-) diff --git a/.github/scripts/install.sh b/.github/scripts/install.sh index b944b7eee..d8e095b90 100644 --- a/.github/scripts/install.sh +++ b/.github/scripts/install.sh @@ -31,22 +31,8 @@ apt-get install -y gstreamer1.0-plugins-base \ postgresql-client # Creating database for testing - setupAirtimePostgresUser() { - # here-doc to execute this block as postgres user - su postgres <<'EOF' - set +e - count=$(psql -d postgres -tAc "SELECT count(*) FROM pg_roles WHERE rolname='airtime';") - if [[ $count -eq 0 ]]; then - psql -d postgres -tAc "CREATE USER airtime WITH ENCRYPTED PASSWORD 'airtime'; ALTER USER airtime CREATEDB; CREATE DATABASE libretime; GRANT CONNECT ON DATABASE libretime TO libretime;" - [[ $? -eq 0 ]] && - echo "Created airtime user in PostgreSQL" || - echo "$0:${FUNCNAME}(): ERROR: Can't create airtime user in PostgreSQL!" - else - echo "airtime user already exists in PostgreSQL" - fi - set -e -# don't indent this! -EOF - } - -setupAirtimePostgresUser \ No newline at end of file +-u postgres psql -c 'CREATE DATABASE libretime;' +-u postgres psql -c "CREATE USER libretime WITH PASSWORD 'libretime';" +-u postgres psql -c 'GRANT CONNECT ON DATABASE libretime TO libretime;' +-u postgres psql -c 'ALTER USER libretime CREATEDB;' +mkdir -p /tmp/log/libretime \ No newline at end of file diff --git a/.github/scripts/python-pkg-test.sh b/.github/scripts/python-pkg-test.sh index c72eefdb6..5bb2c39d8 100644 --- a/.github/scripts/python-pkg-test.sh +++ b/.github/scripts/python-pkg-test.sh @@ -3,10 +3,10 @@ # Starting at repo root cd python_apps/airtime_analyzer -nosetests . +nosetests . -x cd ../api_clients -nosetests . +nosetests . -x # Reset to repo root cd ../.. \ No newline at end of file