From d739930077082018264c17a25c25931b987eaa41 Mon Sep 17 00:00:00 2001 From: BharathKumarRavichandran Date: Sun, 19 Nov 2023 21:22:46 -0600 Subject: [PATCH] Add coverage to integration-test --- .github/workflows/ci.yaml | 9 ++++++++- README.md | 12 ++++++------ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0fef862..e497e89 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -57,6 +57,9 @@ jobs: export DATABASE_URL_TEST="postgresql://${{ env.POSTGRES_USER }}:${{ env.POSTGRES_PASSWORD }}@${{ env.POSTGRES_HOST }}:${{ env.POSTGRES_PORT }}/${{ env.POSTGRES_DB }}" echo $DATABASE_URL_TEST coverage run -m unittest discover -s tests + working-directory: ./ + - name: Generate coverage report + run: | coverage report -m --fail-under=90 working-directory: ./ @@ -92,5 +95,9 @@ jobs: export $(xargs WITH PASSWORD ''; ``` - + Create a database ``` CREATE DATABASE ; - ``` - + ``` + Provide all privileges to your user for your database ``` ALTER USER WITH SUPERUSER; GRANT ALL PRIVILEGES ON DATABASE TO ; ``` - + Type `\q` to exit ##### Create your local connection string @@ -96,7 +96,7 @@ Replace , , and with your chosen v ### Steps to run unit tests 1. Setup the project following the steps in [steps-to-setup-in-local](#steps-to-setup-in-local) -2. #### Setup the Test DB +2. Setup the Test DB Create another database called `test`, and grant all privileges to your user for this database. Follow the same steps [Setup PSQL User](#create-a-user-in-postgreSQL-for-local-setup) Copy the connection string accordingly.