@@ -174,19 +174,19 @@ func TestCollectTextObservationLog(t *testing.T) {
174
174
}
175
175
defer os .RemoveAll (filepath .Dir (testTextDataPath ))
176
176
177
- testCases := map [string ]struct {
178
- filePath string
179
- metrics []string
180
- filters []string
181
- fileFormat commonv1beta1.FileFormat
182
- err bool
183
- expected * v1beta1.ObservationLog
177
+ testCases := map [string ]struct {
178
+ filePath string
179
+ metrics []string
180
+ filters []string
181
+ fileFormat commonv1beta1.FileFormat
182
+ err bool
183
+ expected * v1beta1.ObservationLog
184
184
}{
185
185
"Positive case for logs in TEXT format" : {
186
- filePath : filepath .Join (testTextDataPath , "good.log" ),
187
- metrics : []string {"accuracy" , "loss" },
188
- filters : []string {"{metricName: ([\\ w|-]+), metricValue: ((-?\\ d+)(\\ .\\ d+)?)}" },
189
- fileFormat : commonv1beta1 .TextFormat ,
186
+ filePath : filepath .Join (testTextDataPath , "good.log" ),
187
+ metrics : []string {"accuracy" , "loss" },
188
+ filters : []string {"{metricName: ([\\ w|-]+), metricValue: ((-?\\ d+)(\\ .\\ d+)?)}" },
189
+ fileFormat : commonv1beta1 .TextFormat ,
190
190
expected : & v1beta1.ObservationLog {
191
191
MetricLogs : []* v1beta1.MetricLog {
192
192
{
@@ -228,19 +228,19 @@ func TestCollectTextObservationLog(t *testing.T) {
228
228
},
229
229
},
230
230
"Invalid file name" : {
231
- filePath : "invalid" ,
232
- err : true ,
231
+ filePath : "invalid" ,
232
+ err : true ,
233
233
},
234
234
"Invalid file format" : {
235
- filePath : filepath .Join (testTextDataPath , "good.log" ),
236
- fileFormat : "invalid" ,
237
- err : true ,
235
+ filePath : filepath .Join (testTextDataPath , "good.log" ),
236
+ fileFormat : "invalid" ,
237
+ err : true ,
238
238
},
239
239
"Invalid timestamp for logs in TEXT format" : {
240
- filePath : filepath .Join (testTextDataPath , "invalid-timestamp.log" ),
241
- metrics : []string {"accuracy" , "loss" },
242
- filters : []string {"{metricName: ([\\ w|-]+), metricValue: ((-?\\ d+)(\\ .\\ d+)?)}" },
243
- fileFormat : commonv1beta1 .TextFormat ,
240
+ filePath : filepath .Join (testTextDataPath , "invalid-timestamp.log" ),
241
+ metrics : []string {"accuracy" , "loss" },
242
+ filters : []string {"{metricName: ([\\ w|-]+), metricValue: ((-?\\ d+)(\\ .\\ d+)?)}" },
243
+ fileFormat : commonv1beta1 .TextFormat ,
244
244
expected : & v1beta1.ObservationLog {
245
245
MetricLogs : []* v1beta1.MetricLog {
246
246
{
@@ -261,9 +261,9 @@ func TestCollectTextObservationLog(t *testing.T) {
261
261
},
262
262
},
263
263
"Missing objective metric in training logs" : {
264
- filePath : filepath .Join (testTextDataPath , "missing-objective-metric.log" ),
265
- fileFormat : commonv1beta1 .TextFormat ,
266
- metrics : []string {"accuracy" , "loss" },
264
+ filePath : filepath .Join (testTextDataPath , "missing-objective-metric.log" ),
265
+ fileFormat : commonv1beta1 .TextFormat ,
266
+ metrics : []string {"accuracy" , "loss" },
267
267
expected : & v1beta1.ObservationLog {
268
268
MetricLogs : []* v1beta1.MetricLog {
269
269
{
0 commit comments