Skip to content

Commit

Permalink
Postgres Support (#86)
Browse files Browse the repository at this point in the history
Co-authored-by: Mahan Zendedel DH <[email protected]>
  • Loading branch information
acx1729 and Mahanmmi authored Dec 9, 2024
1 parent 6ab94e1 commit f11d43f
Show file tree
Hide file tree
Showing 8 changed files with 1,156 additions and 32 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/pr-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,26 @@ jobs:
strategy:
matrix:
go-version: [ '1.22.x', '1.21.x', '1.20.x' ]

# Boot up a local, clean postgres instance for the postgres tests
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres:13.18
env:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
POSTGRES_DB: postgres
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432

steps:
# Checks-out your repository under $GITHUB_WORKSPACE
Expand Down Expand Up @@ -57,4 +77,6 @@ jobs:
run: protoc --go_out=. --go-grpc_out=. -I ./submodules/durabletask-protobuf/protos orchestrator_service.proto

- name: Run integration tests
env:
POSTGRES_ENABLED: "true"
run: go test ./tests/... -coverpkg ./api,./task,./client,./backend/...,./internal/helpers
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@

# sqlite databases generated by testing
*.sqlite3
__debug_bin
__debug_bin

.idea/
3 changes: 3 additions & 0 deletions backend/postgres/REAEDME.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Postgres Backend
### Testing
By default, the postgres tests are skipped. To run the tests, set the environment variable `POSTGRES_ENABLED` to `true` before running the tests and have a postgres server running on `localhost:5432` with a database named `postgres` and a user `postgres` with password `postgres`.
Loading

0 comments on commit f11d43f

Please sign in to comment.