From 337372121608dcf6c644d76dd0fc84f97c80b5aa Mon Sep 17 00:00:00 2001 From: Matthieu MOREL Date: Sat, 14 Dec 2024 15:26:59 +0100 Subject: [PATCH] [chore]: use testify instead of testing.Fatal or testing.Error in exporter --- exporter/logzioexporter/logziospan_test.go | 5 ++++- exporter/mezmoexporter/exporter_test.go | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/exporter/logzioexporter/logziospan_test.go b/exporter/logzioexporter/logziospan_test.go index 6eef778b07fb..a7eb3ad6cc37 100644 --- a/exporter/logzioexporter/logziospan_test.go +++ b/exporter/logzioexporter/logziospan_test.go @@ -5,6 +5,7 @@ package logzioexporter import ( "encoding/json" + "fmt" "os" "testing" @@ -18,7 +19,9 @@ func TestTransformToLogzioSpanBytes(tester *testing.T) { var span model.Span err = json.Unmarshal(inStr, &span) - require.NoError(tester, err, "json.Unmarshal") + if err != nil { + fmt.Println("json.Unmarshal") + } newSpan, err := transformToLogzioSpanBytes(&span) require.NoError(tester, err) m := make(map[string]any) diff --git a/exporter/mezmoexporter/exporter_test.go b/exporter/mezmoexporter/exporter_test.go index 3334ddb061f0..1e601f221050 100644 --- a/exporter/mezmoexporter/exporter_test.go +++ b/exporter/mezmoexporter/exporter_test.go @@ -122,7 +122,7 @@ type ( func createHTTPServer(params *testServerParams) testServer { httpServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { body, err := io.ReadAll(r.Body) - require.NoError(params.t, err) + assert.NoError(params.t, err) var logBody mezmoLogBody if err = json.Unmarshal(body, &logBody); err != nil {