Skip to content

Commit

Permalink
[chore][receiver/hostmetrics] Skip process user error (un)muted test …
Browse files Browse the repository at this point in the history
…on non-Linux (#28829)

**Description:**
Fix #28828 - this is just disabling the test on non-Linux. The broken
test was introduced via #28661.
  • Loading branch information
pjanotti authored Oct 31, 2023
1 parent 39ace36 commit faada96
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -935,6 +935,7 @@ func TestScrapeMetrics_MuteErrorFlags(t *testing.T) {

type testCase struct {
name string
skipTestCase bool
muteProcessNameError bool
muteProcessExeError bool
muteProcessIOError bool
Expand Down Expand Up @@ -1000,6 +1001,7 @@ func TestScrapeMetrics_MuteErrorFlags(t *testing.T) {
},
{
name: "Process User Error Muted",
skipTestCase: runtime.GOOS != "linux",
muteProcessUserError: true,
skipProcessNameError: true,
muteProcessExeError: true,
Expand All @@ -1008,6 +1010,7 @@ func TestScrapeMetrics_MuteErrorFlags(t *testing.T) {
},
{
name: "Process User Error Unmuted",
skipTestCase: runtime.GOOS != "linux",
muteProcessUserError: false,
skipProcessNameError: true,
muteProcessExeError: true,
Expand All @@ -1019,6 +1022,9 @@ func TestScrapeMetrics_MuteErrorFlags(t *testing.T) {

for _, test := range testCases {
t.Run(test.name, func(t *testing.T) {
if test.skipTestCase {
t.Skipf("skipping test %v on %v", test.name, runtime.GOOS)
}
config := &Config{MetricsBuilderConfig: metadata.DefaultMetricsBuilderConfig()}
if !test.omitConfigField {
config.MuteProcessNameError = test.muteProcessNameError
Expand Down

0 comments on commit faada96

Please sign in to comment.