From 2bcbcb8fa074358ca929d4430f94518acf6f79a4 Mon Sep 17 00:00:00 2001 From: Ivan Sim Date: Fri, 13 Nov 2020 10:03:29 -0800 Subject: [PATCH] Remove redundant unit test in pkg/util/log The hardcoded GoPath introduced a hard dependency on our local file path. Since we enabled go mod in 4.5, we shouldn't be required to couple ourselves to gopath anymore. Signed-off-by: Ivan Sim --- pkg/util/log/log_test.go | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/pkg/util/log/log_test.go b/pkg/util/log/log_test.go index 2d0a5a884..823d404a9 100644 --- a/pkg/util/log/log_test.go +++ b/pkg/util/log/log_test.go @@ -6,7 +6,6 @@ package log import ( "reflect" "runtime" - "strings" "testing" "github.com/sirupsen/logrus" @@ -76,7 +75,7 @@ func TestRelativeFilePathPrettier(t *testing.T) { currentFrames := runtime.CallersFrames(pc) currentFunc, _ := currentFrames.Next() currentFunc.Line = 11 // so it's not too fragile - goPath := strings.Split(currentFunc.File, "src/github.com")[0] + tests := []struct { name string f *runtime.Frame @@ -95,16 +94,6 @@ func TestRelativeFilePathPrettier(t *testing.T) { wantFunction: "()", wantFile: ":0", }, - { - name: "install", - f: &runtime.Frame{ - Function: "github.com/Azure/ARO-RP/pkg/install/install.deployResourceTemplate", - File: goPath + "src/github.com/Azure/ARO-RP/pkg/install/1-installresources.go", - Line: 623, - }, - wantFunction: "install.deployResourceTemplate()", - wantFile: "pkg/install/1-installresources.go:623", - }, } for _, tt := range tests {