Unverified Commit cade8c41 authored by Franz Pletz's avatar Franz Pletz Committed by GitHub
Browse files

prometheus: Include TestFsType patch (#511840)

parents 0ce3cc05 444fdee5
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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"
+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)