Storage: fix failing test (set IsServiceAccount=true) (#58257)

This commit is contained in:
Ryan McKinley 2022-11-04 09:37:25 -07:00 committed by GitHub
parent d581b368bd
commit 22628d1f7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 6 deletions

View File

@ -42,11 +42,12 @@ func createServiceAccountAdminToken(t *testing.T, env *server.TestEnv) (string,
})
return keyGen.ClientSecret, &user.SignedInUser{
UserID: account.ID,
Email: account.Email,
Name: account.Name,
Login: account.Login,
OrgID: account.OrgID,
UserID: account.ID,
Email: account.Email,
Name: account.Name,
Login: account.Login,
OrgID: account.OrgID,
IsServiceAccount: account.IsServiceAccount,
}
}

View File

@ -8,6 +8,7 @@ import (
"time"
"github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/services/store"
"github.com/grafana/grafana/pkg/services/store/object"
"github.com/grafana/grafana/pkg/util"
"github.com/stretchr/testify/require"
@ -120,7 +121,7 @@ func TestIntegrationObjectServer(t *testing.T) {
testCtx := createTestContext(t)
ctx := metadata.AppendToOutgoingContext(testCtx.ctx, "authorization", fmt.Sprintf("Bearer %s", testCtx.authToken))
fakeUser := fmt.Sprintf("user:%d:%s", testCtx.user.UserID, testCtx.user.Login)
fakeUser := store.GetUserIDString(testCtx.user)
firstVersion := "1"
kind := models.StandardKindJSONObj
grn := &object.GRN{