@@ -65,8 +65,7 @@ func TestBasicNotificationRoundtrip(t *testing.T) {
65
65
interceptor := & syncInterceptor {Store : db }
66
66
cfg := defaultNotificationsConfig (method )
67
67
cfg .RetryInterval = serpent .Duration (time .Hour ) // Ensure retries don't interfere with the test
68
- accessURL := "http://localhost:8080"
69
- mgr , err := notifications .NewManager (cfg , interceptor , accessURL , createMetrics (), logger .Named ("manager" ))
68
+ mgr , err := notifications .NewManager (cfg , interceptor , createMetrics (), logger .Named ("manager" ))
70
69
require .NoError (t , err )
71
70
mgr .WithHandlers (map [database.NotificationMethod ]notifications.Handler {method : handler })
72
71
t .Cleanup (func () {
@@ -139,9 +138,8 @@ func TestSMTPDispatch(t *testing.T) {
139
138
Smarthost : serpent.HostPort {Host : "localhost" , Port : fmt .Sprintf ("%d" , mockSMTPSrv .PortNumber ())},
140
139
Hello : "localhost" ,
141
140
}
142
- accessURL := "http://localhost:8080"
143
- handler := newDispatchInterceptor (dispatch .NewSMTPHandler (cfg .SMTP , accessURL , logger .Named ("smtp" )))
144
- mgr , err := notifications .NewManager (cfg , db , accessURL , createMetrics (), logger .Named ("manager" ))
141
+ handler := newDispatchInterceptor (dispatch .NewSMTPHandler (cfg .SMTP , logger .Named ("smtp" )))
142
+ mgr , err := notifications .NewManager (cfg , db , createMetrics (), logger .Named ("manager" ))
145
143
require .NoError (t , err )
146
144
mgr .WithHandlers (map [database.NotificationMethod ]notifications.Handler {method : handler })
147
145
t .Cleanup (func () {
@@ -202,8 +200,7 @@ func TestWebhookDispatch(t *testing.T) {
202
200
cfg .Webhook = codersdk.NotificationsWebhookConfig {
203
201
Endpoint : * serpent .URLOf (endpoint ),
204
202
}
205
- accessURL := "http://localhost:8080"
206
- mgr , err := notifications .NewManager (cfg , db , accessURL , createMetrics (), logger .Named ("manager" ))
203
+ mgr , err := notifications .NewManager (cfg , db , createMetrics (), logger .Named ("manager" ))
207
204
require .NoError (t , err )
208
205
t .Cleanup (func () {
209
206
assert .NoError (t , mgr .Stop (ctx ))
@@ -301,8 +298,7 @@ func TestBackpressure(t *testing.T) {
301
298
storeInterceptor := & syncInterceptor {Store : db }
302
299
303
300
// GIVEN: a notification manager whose updates will be intercepted
304
- accessURL := "http://localhost:8080"
305
- mgr , err := notifications .NewManager (cfg , storeInterceptor , accessURL , createMetrics (), logger .Named ("manager" ))
301
+ mgr , err := notifications .NewManager (cfg , storeInterceptor , createMetrics (), logger .Named ("manager" ))
306
302
require .NoError (t , err )
307
303
mgr .WithHandlers (map [database.NotificationMethod ]notifications.Handler {method : handler })
308
304
enq , err := notifications .NewStoreEnqueuer (cfg , db , defaultHelpers (), logger .Named ("enqueuer" ))
@@ -397,8 +393,7 @@ func TestRetries(t *testing.T) {
397
393
// Intercept calls to submit the buffered updates to the store.
398
394
storeInterceptor := & syncInterceptor {Store : db }
399
395
400
- accessURL := "http://localhost:8080"
401
- mgr , err := notifications .NewManager (cfg , storeInterceptor , accessURL , createMetrics (), logger .Named ("manager" ))
396
+ mgr , err := notifications .NewManager (cfg , storeInterceptor , createMetrics (), logger .Named ("manager" ))
402
397
require .NoError (t , err )
403
398
t .Cleanup (func () {
404
399
assert .NoError (t , mgr .Stop (ctx ))
@@ -459,8 +454,7 @@ func TestExpiredLeaseIsRequeued(t *testing.T) {
459
454
mgrCtx , cancelManagerCtx := context .WithCancel (context .Background ())
460
455
t .Cleanup (cancelManagerCtx )
461
456
462
- accessURL := "http://localhost:8080"
463
- mgr , err := notifications .NewManager (cfg , noopInterceptor , accessURL , createMetrics (), logger .Named ("manager" ))
457
+ mgr , err := notifications .NewManager (cfg , noopInterceptor , createMetrics (), logger .Named ("manager" ))
464
458
require .NoError (t , err )
465
459
enq , err := notifications .NewStoreEnqueuer (cfg , db , defaultHelpers (), logger .Named ("enqueuer" ))
466
460
require .NoError (t , err )
@@ -507,7 +501,7 @@ func TestExpiredLeaseIsRequeued(t *testing.T) {
507
501
// Intercept calls to submit the buffered updates to the store.
508
502
storeInterceptor := & syncInterceptor {Store : db }
509
503
handler := newDispatchInterceptor (& fakeHandler {})
510
- mgr , err = notifications .NewManager (cfg , storeInterceptor , accessURL , createMetrics (), logger .Named ("manager" ))
504
+ mgr , err = notifications .NewManager (cfg , storeInterceptor , createMetrics (), logger .Named ("manager" ))
511
505
require .NoError (t , err )
512
506
mgr .WithHandlers (map [database.NotificationMethod ]notifications.Handler {method : handler })
513
507
@@ -548,8 +542,7 @@ func TestInvalidConfig(t *testing.T) {
548
542
cfg .DispatchTimeout = serpent .Duration (leasePeriod )
549
543
550
544
// WHEN: the manager is created with invalid config
551
- accessURL := "http://localhost:8080"
552
- _ , err := notifications .NewManager (cfg , db , accessURL , createMetrics (), logger .Named ("manager" ))
545
+ _ , err := notifications .NewManager (cfg , db , createMetrics (), logger .Named ("manager" ))
553
546
554
547
// THEN: the manager will fail to be created, citing invalid config as error
555
548
require .ErrorIs (t , err , notifications .ErrInvalidDispatchTimeout )
@@ -567,8 +560,7 @@ func TestNotifierPaused(t *testing.T) {
567
560
user := createSampleUser (t , db )
568
561
569
562
cfg := defaultNotificationsConfig (method )
570
- accessURL := "http://localhost:8080"
571
- mgr , err := notifications .NewManager (cfg , db , accessURL , createMetrics (), logger .Named ("manager" ))
563
+ mgr , err := notifications .NewManager (cfg , db , createMetrics (), logger .Named ("manager" ))
572
564
require .NoError (t , err )
573
565
mgr .WithHandlers (map [database.NotificationMethod ]notifications.Handler {method : handler })
574
566
t .Cleanup (func () {
@@ -838,9 +830,8 @@ func TestDisabledAfterEnqueue(t *testing.T) {
838
830
839
831
method := database .NotificationMethodSmtp
840
832
cfg := defaultNotificationsConfig (method )
841
- accessURL := "http://localhost:8080"
842
833
843
- mgr , err := notifications .NewManager (cfg , db , accessURL , createMetrics (), logger .Named ("manager" ))
834
+ mgr , err := notifications .NewManager (cfg , db , createMetrics (), logger .Named ("manager" ))
844
835
require .NoError (t , err )
845
836
t .Cleanup (func () {
846
837
assert .NoError (t , mgr .Stop (ctx ))
@@ -946,8 +937,7 @@ func TestCustomNotificationMethod(t *testing.T) {
946
937
Endpoint : * serpent .URLOf (endpoint ),
947
938
}
948
939
949
- accessURL := "http://localhost:8080"
950
- mgr , err := notifications .NewManager (cfg , db , accessURL , createMetrics (), logger .Named ("manager" ))
940
+ mgr , err := notifications .NewManager (cfg , db , createMetrics (), logger .Named ("manager" ))
951
941
require .NoError (t , err )
952
942
t .Cleanup (func () {
953
943
_ = mgr .Stop (ctx )
0 commit comments