@@ -853,11 +853,6 @@ func TestSkippingHardLimitedPresets(t *testing.T) {
853
853
cache := files .New (prometheus .NewRegistry (), & coderdtest.FakeAuthorizer {})
854
854
controller := prebuilds .NewStoreReconciler (db , pubSub , cache , cfg , logger , clock , registry , fakeEnqueuer )
855
855
856
- // Template admin to receive a notification.
857
- templateAdmin := dbgen .User (t , db , database.User {
858
- RBACRoles : []string {codersdk .RoleTemplateAdmin },
859
- })
860
-
861
856
// Set up test environment with a template, version, and preset.
862
857
ownerID := uuid .New ()
863
858
dbgen .User (t , db , database.User {
@@ -938,20 +933,6 @@ func TestSkippingHardLimitedPresets(t *testing.T) {
938
933
require .Equal (t , 1 , len (workspaces ))
939
934
require .Equal (t , database .PrebuildStatusHardLimited , updatedPreset .PrebuildStatus )
940
935
941
- // When hard limit is reached, a notification should be sent.
942
- matching := fakeEnqueuer .Sent (func (notification * notificationstest.FakeNotification ) bool {
943
- if ! assert .Equal (t , notifications .PrebuildFailureLimitReached , notification .TemplateID , "unexpected template" ) {
944
- return false
945
- }
946
-
947
- if ! assert .Equal (t , templateAdmin .ID , notification .UserID , "unexpected receiver" ) {
948
- return false
949
- }
950
-
951
- return true
952
- })
953
- require .Len (t , matching , 1 )
954
-
955
936
// When hard limit is reached, metric is set to 1.
956
937
mf , err = registry .Gather ()
957
938
require .NoError (t , err )
@@ -1016,11 +997,6 @@ func TestHardLimitedPresetShouldNotBlockDeletion(t *testing.T) {
1016
997
cache := files .New (prometheus .NewRegistry (), & coderdtest.FakeAuthorizer {})
1017
998
controller := prebuilds .NewStoreReconciler (db , pubSub , cache , cfg , logger , clock , registry , fakeEnqueuer )
1018
999
1019
- // Template admin to receive a notification.
1020
- templateAdmin := dbgen .User (t , db , database.User {
1021
- RBACRoles : []string {codersdk .RoleTemplateAdmin },
1022
- })
1023
-
1024
1000
// Set up test environment with a template, version, and preset.
1025
1001
ownerID := uuid .New ()
1026
1002
dbgen .User (t , db , database.User {
@@ -1125,20 +1101,6 @@ func TestHardLimitedPresetShouldNotBlockDeletion(t *testing.T) {
1125
1101
require .NoError (t , err )
1126
1102
require .Equal (t , database .PrebuildStatusHardLimited , updatedPreset .PrebuildStatus )
1127
1103
1128
- // When hard limit is reached, a notification should be sent.
1129
- matching := fakeEnqueuer .Sent (func (notification * notificationstest.FakeNotification ) bool {
1130
- if ! assert .Equal (t , notifications .PrebuildFailureLimitReached , notification .TemplateID , "unexpected template" ) {
1131
- return false
1132
- }
1133
-
1134
- if ! assert .Equal (t , templateAdmin .ID , notification .UserID , "unexpected receiver" ) {
1135
- return false
1136
- }
1137
-
1138
- return true
1139
- })
1140
- require .Len (t , matching , 1 )
1141
-
1142
1104
// When hard limit is reached, metric is set to 1.
1143
1105
mf , err = registry .Gather ()
1144
1106
require .NoError (t , err )
0 commit comments