@@ -27,8 +27,10 @@ import (
27
27
"github.com/coder/coder/v2/coderd/database/db2sdk"
28
28
"github.com/coder/coder/v2/coderd/database/dbgen"
29
29
"github.com/coder/coder/v2/coderd/database/dbmem"
30
+ "github.com/coder/coder/v2/coderd/database/dbtestutil"
30
31
"github.com/coder/coder/v2/coderd/database/dbtime"
31
32
"github.com/coder/coder/v2/coderd/httpmw"
33
+ "github.com/coder/coder/v2/coderd/telemetry"
32
34
"github.com/coder/coder/v2/codersdk"
33
35
"github.com/coder/coder/v2/site"
34
36
"github.com/coder/coder/v2/testutil"
@@ -45,9 +47,10 @@ func TestInjection(t *testing.T) {
45
47
binFs := http .FS (fstest.MapFS {})
46
48
db := dbmem .New ()
47
49
handler := site .New (& site.Options {
48
- BinFS :binFs ,
49
- Database :db ,
50
- SiteFS :siteFS ,
50
+ Telemetry :telemetry .NewNoop (),
51
+ BinFS :binFs ,
52
+ Database :db ,
53
+ SiteFS :siteFS ,
51
54
})
52
55
53
56
user := dbgen .User (t ,db , database.User {})
@@ -101,9 +104,10 @@ func TestInjectionFailureProducesCleanHTML(t *testing.T) {
101
104
},
102
105
}
103
106
handler := site .New (& site.Options {
104
- BinFS :binFs ,
105
- Database :db ,
106
- SiteFS :siteFS ,
107
+ Telemetry :telemetry .NewNoop (),
108
+ BinFS :binFs ,
109
+ Database :db ,
110
+ SiteFS :siteFS ,
107
111
108
112
// No OAuth2 configs, refresh will fail.
109
113
OAuth2Configs :& httpmw.OAuth2Configs {
@@ -147,9 +151,12 @@ func TestCaching(t *testing.T) {
147
151
}
148
152
binFS := http .FS (fstest.MapFS {})
149
153
154
+ db ,_ := dbtestutil .NewDB (t )
150
155
srv := httptest .NewServer (site .New (& site.Options {
151
- BinFS :binFS ,
152
- SiteFS :rootFS ,
156
+ Telemetry :telemetry .NewNoop (),
157
+ BinFS :binFS ,
158
+ SiteFS :rootFS ,
159
+ Database :db ,
153
160
}))
154
161
defer srv .Close ()
155
162
@@ -213,9 +220,12 @@ func TestServingFiles(t *testing.T) {
213
220
}
214
221
binFS := http .FS (fstest.MapFS {})
215
222
223
+ db ,_ := dbtestutil .NewDB (t )
216
224
srv := httptest .NewServer (site .New (& site.Options {
217
- BinFS :binFS ,
218
- SiteFS :rootFS ,
225
+ Telemetry :telemetry .NewNoop (),
226
+ BinFS :binFS ,
227
+ SiteFS :rootFS ,
228
+ Database :db ,
219
229
}))
220
230
defer srv .Close ()
221
231
@@ -473,6 +483,7 @@ func TestServingBin(t *testing.T) {
473
483
}
474
484
475
485
srv := httptest .NewServer (site .New (& site.Options {
486
+ Telemetry :telemetry .NewNoop (),
476
487
BinFS :binFS ,
477
488
BinHashes :binHashes ,
478
489
SiteFS :rootFS ,