From 52aea84e79844471d990ac2247ac872d9171fcd1 Mon Sep 17 00:00:00 2001 From: Paulo Janotti Date: Tue, 7 Jan 2025 09:45:54 -0800 Subject: [PATCH] [chore] Fix logzioexporter tests on Windows (#37066) #### Description The test doesn't account that depending on `git` config the endlines of the test files may change from `\n` to `\r\n`. Alternatively we could require/document how `core.autocrlf` should be configured for the repo, but, doing it on code ensures that works with any configuration. This fixes test failures on `TestFromDomainEmbedProcess`, e.g.: https://github.com/open-telemetry/opentelemetry-collector-contrib/actions/runs/12651645455/job/35252663284#step:8:478 #### Testing Local run. #### Documentation N/A --- exporter/logzioexporter/from_domain_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/exporter/logzioexporter/from_domain_test.go b/exporter/logzioexporter/from_domain_test.go index b345d3d961ee..dd7154660f1d 100644 --- a/exporter/logzioexporter/from_domain_test.go +++ b/exporter/logzioexporter/from_domain_test.go @@ -39,8 +39,10 @@ func TestFromDomainEmbedProcess(t *testing.T) { func loadModel(t *testing.T) ([]byte, []byte) { inStr, err := os.ReadFile("./testdata/span.json") require.NoError(t, err) + inStr = bytes.ReplaceAll(inStr, []byte("\r\n"), []byte("\n")) outStr, err := os.ReadFile("./testdata/logziospan.json") require.NoError(t, err) + outStr = bytes.ReplaceAll(outStr, []byte("\r\n"), []byte("\n")) return inStr, outStr }