[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,7 @@
|
||||
package commands
|
||||
|
||||
import (
|
||||
"context"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"time"
|
||||
@@ -67,7 +68,7 @@ func (s *MmctlE2ETestSuite) TestImportUploadCmdF() {
|
||||
userID = "nouser"
|
||||
}
|
||||
|
||||
us, _, err := c.CreateUpload(&model.UploadSession{
|
||||
us, _, err := c.CreateUpload(context.TODO(), &model.UploadSession{
|
||||
Filename: importName,
|
||||
FileSize: 276051,
|
||||
Type: model.UploadTypeImport,
|
||||
@@ -197,7 +198,7 @@ func (s *MmctlE2ETestSuite) TestImportListIncompleteCmdF() {
|
||||
cmd := &cobra.Command{}
|
||||
userID := "nouser"
|
||||
if c == s.th.SystemAdminClient {
|
||||
user, _, err := s.th.SystemAdminClient.GetMe("")
|
||||
user, _, err := s.th.SystemAdminClient.GetMe(context.Background(), "")
|
||||
s.Require().NoError(err)
|
||||
userID = user.Id
|
||||
} else {
|
||||
|
||||
Ссылка в новой задаче
Block a user