Migrate store methods to use request.Context instead of context.Context (#24836)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
0d5a8b8841
Коммит
13c05a571f
@@ -64,7 +64,7 @@ func TestHubStopWithMultipleConnections(t *testing.T) {
|
||||
s := httptest.NewServer(dummyWebsocketHandler(t))
|
||||
defer s.Close()
|
||||
|
||||
session, err := th.Service.CreateSession(&model.Session{
|
||||
session, err := th.Service.CreateSession(th.Context, &model.Session{
|
||||
UserId: th.BasicUser.Id,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
@@ -88,7 +88,7 @@ func TestHubStopRaceCondition(t *testing.T) {
|
||||
// So we just use this quick hack for the test.
|
||||
s := httptest.NewServer(dummyWebsocketHandler(t))
|
||||
|
||||
session, err := th.Service.CreateSession(&model.Session{
|
||||
session, err := th.Service.CreateSession(th.Context, &model.Session{
|
||||
UserId: th.BasicUser.Id,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
@@ -153,8 +153,8 @@ func TestHubSessionRevokeRace(t *testing.T) {
|
||||
|
||||
mockSessionStore := mocks.SessionStore{}
|
||||
mockSessionStore.On("UpdateLastActivityAt", "id1", mock.Anything).Return(nil)
|
||||
mockSessionStore.On("Save", mock.AnythingOfType("*model.Session")).Return(sess1, nil)
|
||||
mockSessionStore.On("Get", mock.Anything, "id1").Return(sess1, nil)
|
||||
mockSessionStore.On("Save", mock.AnythingOfType("*request.Context"), mock.AnythingOfType("*model.Session")).Return(sess1, nil)
|
||||
mockSessionStore.On("Get", mock.AnythingOfType("*request.Context"), mock.Anything, "id1").Return(sess1, nil)
|
||||
mockSessionStore.On("Remove", "id1").Return(nil)
|
||||
|
||||
mockStatusStore := mocks.StatusStore{}
|
||||
@@ -179,7 +179,7 @@ func TestHubSessionRevokeRace(t *testing.T) {
|
||||
s := httptest.NewServer(dummyWebsocketHandler(t))
|
||||
defer s.Close()
|
||||
|
||||
session, err := th.Service.CreateSession(&model.Session{
|
||||
session, err := th.Service.CreateSession(th.Context, &model.Session{
|
||||
UserId: "testid",
|
||||
})
|
||||
require.NoError(t, err)
|
||||
@@ -464,7 +464,7 @@ func TestHubIsRegistered(t *testing.T) {
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
session, err := th.Service.CreateSession(&model.Session{
|
||||
session, err := th.Service.CreateSession(th.Context, &model.Session{
|
||||
UserId: th.BasicUser.Id,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
@@ -488,7 +488,7 @@ func TestHubIsRegistered(t *testing.T) {
|
||||
assert.True(t, th.Service.SessionIsRegistered(*wc2.session.Load()))
|
||||
assert.True(t, th.Service.SessionIsRegistered(*wc3.session.Load()))
|
||||
|
||||
session4, err := th.Service.CreateSession(&model.Session{
|
||||
session4, err := th.Service.CreateSession(th.Context, &model.Session{
|
||||
UserId: th.BasicUser2.Id,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
|
||||
Ссылка в новой задаче
Block a user