@@ -935,6 +935,7 @@ func TestScrapeMetrics_MuteErrorFlags(t *testing.T) {
935
935
936
936
type testCase struct {
937
937
name string
938
+ skipTestCase bool
938
939
muteProcessNameError bool
939
940
muteProcessExeError bool
940
941
muteProcessIOError bool
@@ -1000,6 +1001,7 @@ func TestScrapeMetrics_MuteErrorFlags(t *testing.T) {
1000
1001
},
1001
1002
{
1002
1003
name : "Process User Error Muted" ,
1004
+ skipTestCase : runtime .GOOS != "linux" ,
1003
1005
muteProcessUserError : true ,
1004
1006
skipProcessNameError : true ,
1005
1007
muteProcessExeError : true ,
@@ -1008,6 +1010,7 @@ func TestScrapeMetrics_MuteErrorFlags(t *testing.T) {
1008
1010
},
1009
1011
{
1010
1012
name : "Process User Error Unmuted" ,
1013
+ skipTestCase : runtime .GOOS != "linux" ,
1011
1014
muteProcessUserError : false ,
1012
1015
skipProcessNameError : true ,
1013
1016
muteProcessExeError : true ,
@@ -1019,6 +1022,9 @@ func TestScrapeMetrics_MuteErrorFlags(t *testing.T) {
1019
1022
1020
1023
for _ , test := range testCases {
1021
1024
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
+ }
1022
1028
config := & Config {MetricsBuilderConfig : metadata .DefaultMetricsBuilderConfig ()}
1023
1029
if ! test .omitConfigField {
1024
1030
config .MuteProcessNameError = test .muteProcessNameError
0 commit comments