зеркало из https://github.com/Azure/ARO-RP.git
Merge pull request #1163 from ihcsim/fix-unit-test-filepath
Remove Hardcoded GoPath in Unit Test
This commit is contained in:
Коммит
0c8f352db6
|
@ -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 {
|
||||
|
|
Загрузка…
Ссылка в новой задаче