Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
atoulme committed Jul 24, 2023
1 parent 382bc81 commit 92a9f7a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions receiver/hostmetricsreceiver/hostmetrics_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"path/filepath"
"testing"

"github.com/shirou/gopsutil/v3/common"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.opentelemetry.io/collector/component"
Expand Down Expand Up @@ -46,6 +47,13 @@ func TestLoadConfigRootPath(t *testing.T) {
expectedConfig.RootPath = "testdata"
cpuScraperCfg := (&cpuscraper.Factory{}).CreateDefaultConfig()
cpuScraperCfg.SetRootPath("testdata")
cpuScraperCfg.SetEnvMap(common.EnvMap{
common.HostDevEnvKey: "testdata/dev",
common.HostEtcEnvKey: "testdata/etc",
common.HostRunEnvKey: "testdata/run",
common.HostSysEnvKey: "testdata/sys",
common.HostVarEnvKey: "testdata/var",
})
expectedConfig.Scrapers = map[string]internal.Config{cpuscraper.TypeStr: cpuScraperCfg}

assert.Equal(t, expectedConfig, r)
Expand Down

0 comments on commit 92a9f7a

Please sign in to comment.