Skip to content

Commit f6b56c4

Browse files
chore: adjust file layout using gofmt.
Signed-off-by: Electronic-Waste <[email protected]>
1 parent 876bdf9 commit f6b56c4

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

pkg/metricscollector/v1beta1/file-metricscollector/file-metricscollector_test.go

+23-23
Original file line numberDiff line numberDiff line change
@@ -174,19 +174,19 @@ func TestCollectTextObservationLog(t *testing.T) {
174174
}
175175
defer os.RemoveAll(filepath.Dir(testTextDataPath))
176176

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
184184
}{
185185
"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,
190190
expected: &v1beta1.ObservationLog{
191191
MetricLogs: []*v1beta1.MetricLog{
192192
{
@@ -228,19 +228,19 @@ func TestCollectTextObservationLog(t *testing.T) {
228228
},
229229
},
230230
"Invalid file name": {
231-
filePath: "invalid",
232-
err: true,
231+
filePath: "invalid",
232+
err: true,
233233
},
234234
"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,
238238
},
239239
"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,
244244
expected: &v1beta1.ObservationLog{
245245
MetricLogs: []*v1beta1.MetricLog{
246246
{
@@ -261,9 +261,9 @@ func TestCollectTextObservationLog(t *testing.T) {
261261
},
262262
},
263263
"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"},
267267
expected: &v1beta1.ObservationLog{
268268
MetricLogs: []*v1beta1.MetricLog{
269269
{

0 commit comments

Comments
 (0)