From f030354c06a3b465e6f2fc649a36a75d40165d9f Mon Sep 17 00:00:00 2001 From: Dane Strandboge <136023093+DStrand1@users.noreply.github.com> Date: Mon, 10 Jun 2024 16:58:08 -0500 Subject: [PATCH] fix test failures --- plugins/parsers/json/parser_test.go | 4 ++-- plugins/parsers/xpath/parser_test.go | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/parsers/json/parser_test.go b/plugins/parsers/json/parser_test.go index a182e0a7cc3c7..badc9b4a50018 100644 --- a/plugins/parsers/json/parser_test.go +++ b/plugins/parsers/json/parser_test.go @@ -1491,7 +1491,7 @@ func FuzzParserJSON(f *testing.F) { require.NoError(f, parser.Init()) f.Fuzz(func(t *testing.T, input []byte) { - _, err := parser.Parse(input) - require.NoError(t, err) + //nolint:errcheck // fuzz testing can give lots of errors, but we just want to test for crashes + parser.Parse(input) }) } diff --git a/plugins/parsers/xpath/parser_test.go b/plugins/parsers/xpath/parser_test.go index 67e7d3cc81af1..76997d98612a6 100644 --- a/plugins/parsers/xpath/parser_test.go +++ b/plugins/parsers/xpath/parser_test.go @@ -1345,11 +1345,11 @@ func TestTestCases(t *testing.T) { require.NoError(t, err) // Get the expectations - expectedOutputs, err := testutil.ParseMetricsFrom(header, "Expected Output:", parser) - require.NoError(t, err) + //nolint:errcheck // these may not be set by the testcase, in which case it would error correctly + expectedOutputs, _ := testutil.ParseMetricsFrom(header, "Expected Output:", parser) - expectedErrors, err := testutil.ParseRawLinesFrom(header, "Expected Error:") - require.NoError(t, err) + //nolint:errcheck // these may not be set by the testcase, in which case it would error correctly + expectedErrors, _ := testutil.ParseRawLinesFrom(header, "Expected Error:") // Setup the parser and run it. metricName := "xml"