diff --git a/output/csv/config_test.go b/output/csv/config_test.go index c05f51c13e8..7f76e39c3d3 100644 --- a/output/csv/config_test.go +++ b/output/csv/config_test.go @@ -13,6 +13,8 @@ import ( ) func TestNewConfig(t *testing.T) { + t.Parallel() + config := NewConfig() assert.Equal(t, "file.csv", config.FileName.String) assert.Equal(t, "1s", config.SaveInterval.String()) @@ -20,6 +22,8 @@ func TestNewConfig(t *testing.T) { } func TestApply(t *testing.T) { + t.Parallel() + configs := []Config{ { FileName: null.StringFrom(""), @@ -52,7 +56,10 @@ func TestApply(t *testing.T) { for i := range configs { config := configs[i] expected := expected[i] + t.Run(expected.FileName+"_"+expected.SaveInterval, func(t *testing.T) { + t.Parallel() + baseConfig := NewConfig() baseConfig = baseConfig.Apply(config) @@ -64,6 +71,8 @@ func TestApply(t *testing.T) { } func TestParseArg(t *testing.T) { + t.Parallel() + cases := map[string]struct { config Config expectedLogEntries []string @@ -100,6 +109,8 @@ func TestParseArg(t *testing.T) { testCase := testCase t.Run(arg, func(t *testing.T) { + t.Parallel() + config, err := ParseArg(arg) if testCase.expectedErr { diff --git a/output/csv/output_test.go b/output/csv/output_test.go index 8e85d3b9592..ff7f4fffdff 100644 --- a/output/csv/output_test.go +++ b/output/csv/output_test.go @@ -22,6 +22,8 @@ import ( ) func TestMakeHeader(t *testing.T) { + t.Parallel() + testdata := map[string][]string{ "One tag": { "tag1", @@ -33,7 +35,10 @@ func TestMakeHeader(t *testing.T) { for testname, tags := range testdata { testname, tags := testname, tags + t.Run(testname, func(t *testing.T) { + t.Parallel() + header := MakeHeader(tags) assert.Equal(t, len(tags)+5, len(header)) assert.Equal(t, "metric_name", header[0]) @@ -46,6 +51,8 @@ func TestMakeHeader(t *testing.T) { } func TestSampleToRow(t *testing.T) { + t.Parallel() + registry := metrics.NewRegistry() testMetric, err := registry.NewMetric("my_metric", metrics.Gauge) require.NoError(t, err) @@ -306,6 +313,8 @@ func TestSampleToRow(t *testing.T) { expectedRow := expected[i] t.Run(testname, func(t *testing.T) { + t.Parallel() + row := SampleToRow(sample, resTags, ignoredTags, make([]string, 3+len(resTags)+2), timeFormat) for ind, cell := range expectedRow.baseRow { assert.Equal(t, cell, row[ind]) @@ -323,7 +332,7 @@ func readUnCompressedFile(fileName string, fs fsext.Fs) string { return err.Error() } - return fmt.Sprintf("%s", csvbytes) + return string(csvbytes) } func readCompressedFile(fileName string, fs fsext.Fs) string { @@ -342,7 +351,7 @@ func readCompressedFile(fileName string, fs fsext.Fs) string { return err.Error() } - return fmt.Sprintf("%s", csvbytes) + return string(csvbytes) } func TestRun(t *testing.T) {