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 (open-telemetry#28829)

**Description:**
Fix open-telemetry#28828 - this is just disabling the test on non-Linux. The broken
test was introduced via open-telemetry#28661.
  • Loading branch information
pjanotti authored and RoryCrispin committed Nov 24, 2023
1 parent 945f574 commit a08f4da
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 a08f4da

Please sign in to comment.