File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121 with :
2222 mongodb-version : 4.2
2323
24+ - name : Start PostgreSQL 14
25+ uses : harmon758/postgresql-action@v1
26+ with :
27+ postgresql db : testdb
28+ postgresql user : testuser
29+ postgresql password : testpw
30+ postgresql version : ' 14'
31+
2432 - uses : niden/actions-memcached@v7
2533
2634 - name : Set up Go ${{ matrix.go }}
Original file line number Diff line number Diff line change @@ -4,19 +4,13 @@ import (
44 "database/sql"
55 "github.com/gin-contrib/sessions"
66 "github.com/gin-contrib/sessions/tester"
7- "os"
87 "testing"
98)
109
10+ const postgresTestServer = "postgres://testuser:testpw@localhost:5432/testdb?sslmode=disable"
1111
1212var newStore = func (_ * testing.T ) sessions.Store {
13- // Env var in the format postgresql://username:password@localhost:5432/database?sslmode=disable required
14- dsn := os .Getenv ("SESSIONS_POSTGRES_TEST" )
15- if dsn == "" {
16- panic ("database connection is required" )
17- }
18-
19- db , err := sql .Open ("postgres" , dsn )
13+ db , err := sql .Open ("postgres" , postgresTestServer )
2014 if err != nil {
2115 panic (err )
2216 }
You can’t perform that action at this time.
0 commit comments