Skip to content

Commit ced31a4

Browse files
authored
fix: drop hard-coded package name in the UTs of the new error handling package (kubefleet-dev#709)
1 parent f93a1cb commit ced31a4

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

pkg/utils/errors/errors_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ func TestCommonUsePatterns(t *testing.T) {
9494
"errCategory=unexpected",
9595
"k1=v1",
9696
"callers=",
97-
"Function:github.com/kubefleet-dev/kubefleet/pkg/utils/errors.TestCommonUsePatterns",
97+
"Function:",
98+
"/pkg/utils/errors.TestCommonUsePatterns",
9899
"k2=v2",
99100
}
100101
for _, subStr := range wantSubStrings {
@@ -557,7 +558,7 @@ func TestNewUnexpectedError(t *testing.T) {
557558

558559
// Verify the first frame (the current test code).
559560
callerFunc := frames[0].Function
560-
if callerFunc != "github.com/kubefleet-dev/kubefleet/pkg/utils/errors.TestNewUnexpectedError" {
561+
if !strings.Contains(callerFunc, "/pkg/utils/errors.TestNewUnexpectedError") {
561562
t.Errorf("NewUnexpectedError() first caller function = %s, want TestNewUnexpectedError", callerFunc)
562563
}
563564
callerFile := frames[0].File

0 commit comments

Comments
 (0)