File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11name : Go Unit Tests
22
3+ # User-management tests need Postgres.
4+ # Repository secret TEST_POSTGRES_PASSWORD
5+
36on :
47 push :
58 branches : [ main ]
1821 image : postgres:16-alpine
1922 env :
2023 POSTGRES_USER : altsuite
21- POSTGRES_PASSWORD : altsuite
24+ POSTGRES_PASSWORD : ${{ secrets.TEST_POSTGRES_PASSWORD }}
2225 POSTGRES_DB : altsuite
2326 ports :
2427 - 5432:5432
3639 go-version : ' 1.24'
3740 - name : Run unit tests and generate coverage
3841 env :
39- DATABASE_URL : postgres://altsuite:altsuite @localhost:5432/altsuite?sslmode=disable
42+ DATABASE_URL : postgres://altsuite:${{ secrets.TEST_POSTGRES_PASSWORD }} @localhost:5432/altsuite?sslmode=disable
4043 run : |
4144 cd api
4245 go test -v -race -coverprofile=coverage.out -coverpkg=./... ./... | tee test_output.txt
Original file line number Diff line number Diff line change @@ -130,6 +130,9 @@ go run .
130130- ** Development** : Go 1.21+, Node.js 18+
131131- ** Production** : Linux system (systemd recommended)
132132
133+ ## CI
134+
135+ The Go test workflow runs user-management tests against Postgres. Add a repository secret ** ` TEST_POSTGRES_PASSWORD ` **
133136
134137## Contributors
135138
Original file line number Diff line number Diff line change 11# Postgres container for AltSuite user management.
2- # Run from this directory: docker compose up -d
3- # Then set DATABASE_URL when starting AltSuite, e.g.:
4- # DATABASE_URL=postgres://altsuite:YOUR_PASSWORD@localhost:5432/altsuite?sslmode=disable
2+ # Run from this directory:
3+ # export POSTGRES_PASSWORD='your-secure-password'
4+ # docker compose up -d
5+ # Then set DATABASE_URL when starting AltSuite:
6+ # DATABASE_URL=postgres://altsuite:your-secure-password@127.0.0.1:5432/altsuite?sslmode=disable
57
68services :
79 postgres :
810 image : postgres:16-alpine
911 restart : unless-stopped
1012 environment :
1113 POSTGRES_USER : altsuite
12- POSTGRES_PASSWORD : ${POSTGRES_PASSWORD:-altsuite }
14+ POSTGRES_PASSWORD : ${POSTGRES_PASSWORD}
1315 POSTGRES_DB : altsuite
1416 ports :
1517 - " 127.0.0.1:5432:5432"
You can’t perform that action at this time.
0 commit comments