Loading pkgs/by-name/pr/prometheus/package.nix +6 −0 Original line number Diff line number Diff line Loading @@ -63,6 +63,8 @@ let env.CI = true; __darwinAllowLocalNetworking = true; doCheck = true; checkPhase = '' runHook preCheck Loading Loading @@ -92,6 +94,10 @@ buildGoModule (finalAttrs: { proxyVendor = true; patches = [ ./prometheus-pr18519-fix-TestFsType.patch ]; outputs = [ "out" "doc" Loading pkgs/by-name/pr/prometheus/prometheus-pr18519-fix-TestFsType.patch 0 → 100644 +25 −0 Original line number Diff line number Diff line --- 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) Loading
pkgs/by-name/pr/prometheus/package.nix +6 −0 Original line number Diff line number Diff line Loading @@ -63,6 +63,8 @@ let env.CI = true; __darwinAllowLocalNetworking = true; doCheck = true; checkPhase = '' runHook preCheck Loading Loading @@ -92,6 +94,10 @@ buildGoModule (finalAttrs: { proxyVendor = true; patches = [ ./prometheus-pr18519-fix-TestFsType.patch ]; outputs = [ "out" "doc" Loading
pkgs/by-name/pr/prometheus/prometheus-pr18519-fix-TestFsType.patch 0 → 100644 +25 −0 Original line number Diff line number Diff line --- 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)