[MM-49989] Pass a context.Context to Client4 methods (#22922)
* Migrate all method in model/client4.go to accept a context.Context * Fix th.*Client * Fix remaining issues * Empty commit to triger CI * Fix test * Add cancellation test * Test that returned error is context.Canceled * Fix bad merge * Update mmctl code --------- Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
7116e9267a
Коммит
6c82605df0
@@ -4,6 +4,8 @@
|
||||
package commands
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/mattermost/mattermost-server/server/public/model"
|
||||
|
||||
"github.com/mattermost/mattermost-server/server/v8/cmd/mmctl/printer"
|
||||
@@ -27,7 +29,7 @@ func (s *MmctlUnitTestSuite) TestSamlAuthDataReset() {
|
||||
|
||||
s.client.
|
||||
EXPECT().
|
||||
ResetSamlAuthDataToEmail(false, false, []string{}).
|
||||
ResetSamlAuthDataToEmail(context.Background(), false, false, []string{}).
|
||||
Return(int64(1), &model.Response{}, nil).
|
||||
Times(1)
|
||||
|
||||
@@ -47,7 +49,7 @@ func (s *MmctlUnitTestSuite) TestSamlAuthDataReset() {
|
||||
|
||||
s.client.
|
||||
EXPECT().
|
||||
ResetSamlAuthDataToEmail(false, true, []string{}).
|
||||
ResetSamlAuthDataToEmail(context.Background(), false, true, []string{}).
|
||||
Return(int64(1), &model.Response{}, nil).
|
||||
Times(1)
|
||||
|
||||
@@ -63,7 +65,7 @@ func (s *MmctlUnitTestSuite) TestSamlAuthDataReset() {
|
||||
users := []string{"user1"}
|
||||
s.client.
|
||||
EXPECT().
|
||||
ResetSamlAuthDataToEmail(false, false, users).
|
||||
ResetSamlAuthDataToEmail(context.Background(), false, false, users).
|
||||
Return(int64(1), &model.Response{}, nil).
|
||||
Times(1)
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user