File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ import (
18
18
"net/http"
19
19
"os"
20
20
"path/filepath"
21
+ "strings"
21
22
"testing"
22
23
23
24
"github.com/stretchr/testify/assert"
@@ -27,17 +28,17 @@ import (
27
28
"go.opentelemetry.io/collector/config"
28
29
)
29
30
30
- const testFolder = "testdata"
31
-
32
31
func newStubPromChecker () (prometheusChecker , error ) {
33
- promResponse , err := os .ReadFile (filepath .Join (testFolder , "prometheus_response" ))
32
+ promBytes , err := os .ReadFile (filepath .Join ("testdata" , "prometheus_response" ))
34
33
if err != nil {
35
34
return prometheusChecker {}, err
36
35
}
37
36
37
+ promResponse := strings .ReplaceAll (string (promBytes ), "\r \n " , "\n " )
38
+
38
39
return prometheusChecker {
39
40
promHandler : http .HandlerFunc (func (w http.ResponseWriter , _ * http.Request ) {
40
- _ , _ = w .Write (promResponse )
41
+ _ , _ = w .Write ([] byte ( promResponse ) )
41
42
}),
42
43
}, nil
43
44
}
You can’t perform that action at this time.
0 commit comments