Merge pull request #7142 from leseb/unit-test-ouside-gopath

ceph: do not force go path in unit tests
This commit is contained in:
Sébastien Han authored and GitHub committed 2021-02-03 09:11:15 +01:00
commit 2bc5fbf84f
1 file changed
+2 -3
+2 -3
View File
@@ -18,7 +18,6 @@ limitations under the License.
package k8sutil
import (
"os"
"path"
"testing"
@@ -38,8 +37,8 @@ func TestGetServiceMonitor(t *testing.T) {
}
func TestGetPrometheusRule(t *testing.T) {
gopath := os.Getenv("GOPATH")
filePath := path.Join(gopath, "src/github.com/rook/rook/cluster/examples/kubernetes/ceph/monitoring/prometheus-ceph-v14-rules.yaml")
projectRoot := util.PathToProjectRoot()
filePath := path.Join(projectRoot, "/cluster/examples/kubernetes/ceph/monitoring/prometheus-ceph-v14-rules.yaml")
rules, err := GetPrometheusRule(filePath)
assert.Nil(t, err)
assert.Equal(t, "prometheus-ceph-rules", rules.GetName())