Skip to content

Commit 2aabd6d

Browse files
acx1729Mahanmmi
authored andcommitted
Postgres Support (microsoft#86)
Co-authored-by: Mahan Zendedel DH <[email protected]>
1 parent c6bfdd9 commit 2aabd6d

File tree

8 files changed

+1109
-190
lines changed

8 files changed

+1109
-190
lines changed

.github/workflows/pr-validation.yml

+21
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,25 @@ jobs:
2828
matrix:
2929
go-version: [ '1.23.x' ]
3030

31+
# Boot up a local, clean postgres instance for the postgres tests
32+
services:
33+
# Label used to access the service container
34+
postgres:
35+
# Docker Hub image
36+
image: postgres:13.18
37+
env:
38+
POSTGRES_PASSWORD: postgres
39+
POSTGRES_USER: postgres
40+
POSTGRES_DB: postgres
41+
# Set health checks to wait until postgres has started
42+
options: >-
43+
--health-cmd pg_isready
44+
--health-interval 10s
45+
--health-timeout 5s
46+
--health-retries 5
47+
ports:
48+
# Maps tcp port 5432 on service container to the host
49+
- 5432:5432
3150
steps:
3251
# Checks-out your repository under $GITHUB_WORKSPACE
3352
- uses: actions/checkout@v3
@@ -57,4 +76,6 @@ jobs:
5776
run: protoc --go_out=. --go-grpc_out=. -I ./submodules/durabletask-protobuf/protos orchestrator_service.proto
5877

5978
- name: Run integration tests
79+
env:
80+
POSTGRES_ENABLED: "true"
6081
run: go test ./tests/... -coverpkg ./api,./task,./client,./backend/...,./api/helpers

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,6 @@
1717

1818
# sqlite databases generated by testing
1919
*.sqlite3
20-
__debug_bin
20+
__debug_bin
21+
22+
.idea/

backend/postgres/REAEDME.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Postgres Backend
2+
### Testing
3+
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`.

0 commit comments

Comments
 (0)