@@ -16,6 +16,7 @@ import (
16
16
"github.com/staticbackendhq/core/database/postgresql"
17
17
"github.com/staticbackendhq/core/email"
18
18
"github.com/staticbackendhq/core/internal"
19
+ "github.com/staticbackendhq/core/logger"
19
20
"github.com/staticbackendhq/core/storage"
20
21
)
21
22
43
44
func TestMain (m * testing.M ) {
44
45
config .Current = config .LoadConfig ()
45
46
46
- volatile = cache .NewCache ()
47
+ logz := logger .Get (config .Current )
48
+
49
+ volatile = cache .NewCache (logz )
47
50
48
51
storer = storage.Local {}
49
52
@@ -53,19 +56,19 @@ func TestMain(m *testing.M) {
53
56
log .Fatal (err )
54
57
}
55
58
56
- datastore = mongo .New (cl , volatile .PublishDocument )
59
+ datastore = mongo .New (cl , volatile .PublishDocument , logz )
57
60
} else {
58
61
dbConn , err := openPGDatabase ("user=postgres password=postgres dbname=postgres sslmode=disable" )
59
62
if err != nil {
60
63
log .Fatal (err )
61
64
}
62
65
63
- datastore = postgresql .New (dbConn , volatile .PublishDocument , "./sql/" )
66
+ datastore = postgresql .New (dbConn , volatile .PublishDocument , "./sql/" , logz )
64
67
}
65
68
66
- database = & Database {cache : volatile }
69
+ database = & Database {cache : volatile , log : logz }
67
70
68
- mship = & membership {}
71
+ mship = & membership {log : logz }
69
72
70
73
mp := config .Current .MailProvider
71
74
if strings .EqualFold (mp , internal .MailProviderSES ) {
@@ -80,7 +83,7 @@ func TestMain(m *testing.M) {
80
83
go hub .run ()
81
84
82
85
ws := httptest .NewServer (http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
83
- serveWs (hub , w , r )
86
+ serveWs (logz , hub , w , r )
84
87
}))
85
88
defer ws .Close ()
86
89
0 commit comments