Skip to content

Commit

Permalink
[cmd/opampsupervisor] fix failed test in windows (open-telemetry#30690)
Browse files Browse the repository at this point in the history
**Description:** 
fix opampsupervisor failed test in windows

https://github.com/open-telemetry/opentelemetry-collector-contrib/actions/runs/7535309382/job/20512459704
```
--- FAIL: Test_composeEffectiveConfig (0.00s)
    supervisor_test.go:57: 
        	Error Trace:	D:/a/opentelemetry-collector-contrib/opentelemetry-collector-contrib/cmd/opampsupervisor/supervisor/supervisor_test.go:57
        	Error:      	Not equal: 
        	            	expected: "extensions:\r\n    health_check:\r\n        endpoint: localhost:8000\r\nservice:\r\n    extensions:\r\n        - health_check\r\n    telemetry:\r\n        logs:\r\n            encoding: json\r\n        resource:\r\n            service.name: otelcol\r\n"
        	            	actual  : "extensions:\n    health_check:\n        endpoint: localhost:8000\nservice:\n    extensions:\n        - health_check\n    telemetry:\n        logs:\n            encoding: json\n        resource:\n            service.name: otelcol\n"

```

**Documentation:** <Describe the documentation added.>

Signed-off-by: Ziqi Zhao <[email protected]>
  • Loading branch information
fatsheep9146 committed Jan 20, 2024
1 parent bd1d706 commit 38c5be1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmd/opampsupervisor/supervisor/supervisor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package supervisor

import (
"bytes"
"os"
"sync/atomic"
"testing"
Expand Down Expand Up @@ -52,6 +53,7 @@ func Test_composeEffectiveConfig(t *testing.T) {

expectedConfig, err := os.ReadFile("../testdata/collector/effective_config.yaml")
require.NoError(t, err)
expectedConfig = bytes.ReplaceAll(expectedConfig, []byte("\r\n"), []byte("\n"))

require.True(t, configChanged)
require.Equal(t, string(expectedConfig), s.effectiveConfig.Load().(string))
Expand Down

0 comments on commit 38c5be1

Please sign in to comment.