Skip to content

Commit 876f489

Browse files
authored
Merge pull request #1532 from nrb/pass-test-filepath
Use a guaranteed missing file in shared token tests
2 parents 5cf8de0 + a27d92a commit 876f489

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pkg/common/vclib/vc_session_manager_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,10 @@ func TestGetSharedToken(t *testing.T) {
7878

7979
t.Run("should fail when no token is passed and SA token cannot be read", func(t *testing.T) {
8080
_, err := vclib.GetSharedToken(ctx, vclib.SharedTokenOptions{
81-
URL: "http://something.tld/lala",
81+
URL: "http://something.tld/lala",
82+
TokenFile: "/var/run/secrets/test-token",
8283
})
83-
assert.ErrorContains(t, err, "failed reading token from service account: open /var/run/secrets/kubernetes.io/serviceaccount/token: no such file or directory")
84+
assert.ErrorContains(t, err, "failed reading token from service account: open /var/run/secrets/test-token: no such file or directory")
8485
})
8586

8687
t.Run("should fail when passed URL is invalid", func(t *testing.T) {

0 commit comments

Comments
 (0)