@@ -1143,7 +1143,7 @@ func TestTemplateInsights_Golden(t *testing.T) {
1143
1143
makeRequest : func (templates []* testTemplate ) codersdk.TemplateInsightsRequest {
1144
1144
return codersdk.TemplateInsightsRequest {
1145
1145
StartTime : weekAgo ,
1146
- EndTime : lastNight ,
1146
+ EndTime : weekAgo . AddDate ( 0 , 0 , 7 ) ,
1147
1147
Interval : codersdk .InsightsReportIntervalDay ,
1148
1148
}
1149
1149
},
@@ -1154,7 +1154,7 @@ func TestTemplateInsights_Golden(t *testing.T) {
1154
1154
return codersdk.TemplateInsightsRequest {
1155
1155
TemplateIDs : []uuid.UUID {templates [0 ].id , templates [1 ].id , templates [2 ].id },
1156
1156
StartTime : weekAgo ,
1157
- EndTime : lastNight ,
1157
+ EndTime : weekAgo . AddDate ( 0 , 0 , 7 ) ,
1158
1158
Interval : codersdk .InsightsReportIntervalDay ,
1159
1159
}
1160
1160
},
@@ -1165,7 +1165,7 @@ func TestTemplateInsights_Golden(t *testing.T) {
1165
1165
return codersdk.TemplateInsightsRequest {
1166
1166
TemplateIDs : []uuid.UUID {templates [0 ].id },
1167
1167
StartTime : weekAgo ,
1168
- EndTime : lastNight ,
1168
+ EndTime : weekAgo . AddDate ( 0 , 0 , 7 ) ,
1169
1169
Interval : codersdk .InsightsReportIntervalDay ,
1170
1170
}
1171
1171
},
@@ -1176,7 +1176,7 @@ func TestTemplateInsights_Golden(t *testing.T) {
1176
1176
return codersdk.TemplateInsightsRequest {
1177
1177
TemplateIDs : []uuid.UUID {templates [1 ].id },
1178
1178
StartTime : weekAgo ,
1179
- EndTime : lastNight ,
1179
+ EndTime : weekAgo . AddDate ( 0 , 0 , 7 ) ,
1180
1180
Interval : codersdk .InsightsReportIntervalDay ,
1181
1181
}
1182
1182
},
@@ -1187,7 +1187,7 @@ func TestTemplateInsights_Golden(t *testing.T) {
1187
1187
return codersdk.TemplateInsightsRequest {
1188
1188
TemplateIDs : []uuid.UUID {templates [2 ].id },
1189
1189
StartTime : weekAgo ,
1190
- EndTime : lastNight ,
1190
+ EndTime : weekAgo . AddDate ( 0 , 0 , 7 ) ,
1191
1191
Interval : codersdk .InsightsReportIntervalDay ,
1192
1192
}
1193
1193
},
@@ -1233,7 +1233,7 @@ func TestTemplateInsights_Golden(t *testing.T) {
1233
1233
}
1234
1234
}
1235
1235
1236
- client , toStableTemplateID := prepare (t , templates , users , testData )
1236
+ client , toStableTemplateIDs := prepare (t , templates , users , testData )
1237
1237
1238
1238
for _ , req := range tt .requests {
1239
1239
req := req
@@ -1245,7 +1245,7 @@ func TestTemplateInsights_Golden(t *testing.T) {
1245
1245
report , err := client .TemplateInsights (ctx , req .makeRequest (templates ))
1246
1246
require .NoError (t , err , "want no error getting template insights" )
1247
1247
1248
- stabilizeReportForGoldenComparison (& report , toStableTemplateID )
1248
+ stabilizeReportForGoldenComparison (& report , toStableTemplateIDs )
1249
1249
1250
1250
partialName := strings .Join (strings .Split (t .Name (), "/" )[1 :], "_" )
1251
1251
goldenFile := filepath .Join ("testdata" , "insights" , partialName + ".json.golden" )
0 commit comments