зеркало из https://github.com/Azure/ARO-RP.git
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 <isim@redhat.com>
This commit is contained in:
Родитель
754020de13
Коммит
2bcbcb8fa0
|
@ -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 {
|
||||
|
|
Загрузка…
Ссылка в новой задаче