prometheus: Include TestFsType patch (#511840)
This commit is contained in:
@@ -63,6 +63,8 @@ let
|
||||
|
||||
env.CI = true;
|
||||
|
||||
__darwinAllowLocalNetworking = true;
|
||||
|
||||
doCheck = true;
|
||||
checkPhase = ''
|
||||
runHook preCheck
|
||||
@@ -92,6 +94,10 @@ buildGoModule (finalAttrs: {
|
||||
|
||||
proxyVendor = true;
|
||||
|
||||
patches = [
|
||||
./prometheus-pr18519-fix-TestFsType.patch
|
||||
];
|
||||
|
||||
outputs = [
|
||||
"out"
|
||||
"doc"
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
--- a/util/runtime/statfs_unix_test.go
|
||||
+++ b/util/runtime/statfs_unix_test.go
|
||||
@@ -19,20 +19,18 @@ import (
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
- "github.com/grafana/regexp"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
-var regexpFsType = regexp.MustCompile("^[A-Z][A-Z0-9_]*_MAGIC$")
|
||||
-
|
||||
func TestFsType(t *testing.T) {
|
||||
var fsType string
|
||||
|
||||
path, err := os.Getwd()
|
||||
require.NoError(t, err)
|
||||
|
||||
+ // A real path must yield a non-zero filesystem type.
|
||||
fsType = FsType(path)
|
||||
- require.Regexp(t, regexpFsType, fsType)
|
||||
+ require.NotEqual(t, "0", fsType)
|
||||
|
||||
fsType = FsType("/no/where/to/be/found")
|
||||
require.Equal(t, "0", fsType)
|
||||
Reference in New Issue
Block a user