Skip to content

Commit bbf86c3

Browse files
pjanottijmsnll
authored andcommitted
[chore][receiver/hostmetrics] Skip process user error (un)muted test 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.
1 parent 9b3de77 commit bbf86c3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

receiver/hostmetricsreceiver/internal/scraper/processscraper/process_scraper_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -935,6 +935,7 @@ func TestScrapeMetrics_MuteErrorFlags(t *testing.T) {
935935

936936
type testCase struct {
937937
name string
938+
skipTestCase bool
938939
muteProcessNameError bool
939940
muteProcessExeError bool
940941
muteProcessIOError bool
@@ -1000,6 +1001,7 @@ func TestScrapeMetrics_MuteErrorFlags(t *testing.T) {
10001001
},
10011002
{
10021003
name: "Process User Error Muted",
1004+
skipTestCase: runtime.GOOS != "linux",
10031005
muteProcessUserError: true,
10041006
skipProcessNameError: true,
10051007
muteProcessExeError: true,
@@ -1008,6 +1010,7 @@ func TestScrapeMetrics_MuteErrorFlags(t *testing.T) {
10081010
},
10091011
{
10101012
name: "Process User Error Unmuted",
1013+
skipTestCase: runtime.GOOS != "linux",
10111014
muteProcessUserError: false,
10121015
skipProcessNameError: true,
10131016
muteProcessExeError: true,
@@ -1019,6 +1022,9 @@ func TestScrapeMetrics_MuteErrorFlags(t *testing.T) {
10191022

10201023
for _, test := range testCases {
10211024
t.Run(test.name, func(t *testing.T) {
1025+
if test.skipTestCase {
1026+
t.Skipf("skipping test %v on %v", test.name, runtime.GOOS)
1027+
}
10221028
config := &Config{MetricsBuilderConfig: metadata.DefaultMetricsBuilderConfig()}
10231029
if !test.omitConfigField {
10241030
config.MuteProcessNameError = test.muteProcessNameError

0 commit comments

Comments
 (0)