-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Newbie mistakes were made. Fix postgres service
- Loading branch information
Showing
2 changed files
with
11 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,10 @@ echo "Starting ${GITHUB_WORKFLOW}:${GITHUB_ACTION}" | |
APP=$1 | ||
MIN_COVERAGE=$2 | ||
|
||
# start PostgreSQL | ||
service postgresql start | ||
|
||
# setup run settings | ||
if [ -z "${APP}" ]; then | ||
# coverage on everything when app is empty | ||
APP_LOCATION="." | ||
|
@@ -17,6 +21,7 @@ else | |
VENV_NAME=virtenv_$APP | ||
fi | ||
|
||
# init virtual environment | ||
if ! [ -e "${GITHUB_WORKSPACE}/${VENV_NAME}" ]; then | ||
python3 -m venv "${GITHUB_WORKSPACE}/${VENV_NAME}" | ||
fi | ||
|
@@ -25,8 +30,9 @@ source "${GITHUB_WORKSPACE}/${VENV_NAME}/bin/activate" | |
|
||
pip install -r requirements.txt | ||
|
||
echo "Base setup complete. Setting up a sample DB url and running..." | ||
export DATABASE_URL='postgresql://ctest:[email protected]:5432/demo' | ||
echo "Base setup complete. Setting up a sample DB url" | ||
|
||
# This will automatically fail (set -e is set by default) if the tests fail, which is OK. | ||
coverage run --source "${APP_LOCATION}" manage.py test "${APP}" | ||
|
||
|