Skip to content

Commit

Permalink
Add coverage to integration-test
Browse files Browse the repository at this point in the history
  • Loading branch information
BharathKumarRavichandran committed Nov 20, 2023
1 parent a1e7904 commit d739930
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: ./

Expand Down Expand Up @@ -92,5 +95,9 @@ jobs:
export $(xargs <ci.env)
export DATABASE_URL_TEST="postgresql://${{ env.POSTGRES_USER }}:${{ env.POSTGRES_PASSWORD }}@${{ env.POSTGRES_HOST }}:${{ env.POSTGRES_PORT }}/${{ env.POSTGRES_DB }}"
echo $DATABASE_URL_TEST
behave
coverage run -m behave
working-directory: ./
- name: Generate coverage report
run: |
coverage report -m --fail-under=90
working-directory: ./
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,23 @@
```
psql -U postgres
```

Create a new user
```
CREATE USER <your_username> WITH PASSWORD '<your_password>';
```

Create a database
```
CREATE DATABASE <your_database>;
```
```

Provide all privileges to your user for your database
```
ALTER USER <your_username> WITH SUPERUSER;
GRANT ALL PRIVILEGES ON DATABASE <your_database> TO <your_username>;
```

Type `\q` to exit

##### Create your local connection string
Expand Down Expand Up @@ -96,7 +96,7 @@ Replace <your_username>, <your_password>, and <your_database> 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.
Expand Down

0 comments on commit d739930

Please sign in to comment.