Этот коммит содержится в:
Ben Schumacher
2021-07-12 20:05:36 +02:00
коммит произвёл Claudio Costa
родитель 953eebdef4
Коммит 97ccf0bdf6
472 изменённых файлов: 9126 добавлений и 9132 удалений

Просмотреть файл

@@ -29,7 +29,7 @@ func TestGetPing(t *testing.T) {
t.Run("healthy", func(t *testing.T) {
status, resp := client.GetPing()
CheckNoError(t, resp)
assert.Equal(t, model.STATUS_OK, status)
assert.Equal(t, model.StatusOk, status)
})
t.Run("unhealthy", func(t *testing.T) {
@@ -41,7 +41,7 @@ func TestGetPing(t *testing.T) {
th.App.UpdateConfig(func(cfg *model.Config) { *cfg.ServiceSettings.GoroutineHealthThreshold = 10 })
status, resp := client.GetPing()
CheckInternalErrorStatus(t, resp)
assert.Equal(t, model.STATUS_UNHEALTHY, status)
assert.Equal(t, model.StatusUnhealthy, status)
})
}, "basic ping")
@@ -50,7 +50,7 @@ func TestGetPing(t *testing.T) {
status, resp := client.GetPingWithServerStatus()
CheckNoError(t, resp)
assert.Equal(t, model.STATUS_OK, status)
assert.Equal(t, model.StatusOk, status)
})
t.Run("unhealthy", func(t *testing.T) {
@@ -63,7 +63,7 @@ func TestGetPing(t *testing.T) {
status, resp := client.GetPingWithServerStatus()
CheckInternalErrorStatus(t, resp)
assert.Equal(t, model.STATUS_UNHEALTHY, status)
assert.Equal(t, model.StatusUnhealthy, status)
})
}, "with server status")
@@ -148,7 +148,7 @@ func TestEmailTest(t *testing.T) {
SMTPServerTimeout: model.NewInt(15),
},
FileSettings: model.FileSettings{
DriverName: model.NewString(model.IMAGE_DRIVER_LOCAL),
DriverName: model.NewString(model.ImageDriverLocal),
Directory: model.NewString(dir),
},
}
@@ -472,9 +472,9 @@ func TestS3TestConnection(t *testing.T) {
s3Endpoint := fmt.Sprintf("%s:%s", s3Host, s3Port)
config := model.Config{
FileSettings: model.FileSettings{
DriverName: model.NewString(model.IMAGE_DRIVER_S3),
AmazonS3AccessKeyId: model.NewString(model.MINIO_ACCESS_KEY),
AmazonS3SecretAccessKey: model.NewString(model.MINIO_SECRET_KEY),
DriverName: model.NewString(model.ImageDriverS3),
AmazonS3AccessKeyId: model.NewString(model.MinioAccessKey),
AmazonS3SecretAccessKey: model.NewString(model.MinioSecretKey),
AmazonS3Bucket: model.NewString(""),
AmazonS3Endpoint: model.NewString(s3Endpoint),
AmazonS3Region: model.NewString(""),
@@ -494,7 +494,7 @@ func TestS3TestConnection(t *testing.T) {
require.Equal(t, resp.Error.Message, "S3 Bucket is required", "should return error - missing s3 bucket")
// If this fails, check the test configuration to ensure minio is setup with the
// `mattermost-test` bucket defined by model.MINIO_BUCKET.
*config.FileSettings.AmazonS3Bucket = model.MINIO_BUCKET
*config.FileSettings.AmazonS3Bucket = model.MinioBucket
config.FileSettings.AmazonS3PathPrefix = model.NewString("")
*config.FileSettings.AmazonS3Region = "us-east-1"
_, resp = th.SystemAdminClient.TestS3Connection(&config)
@@ -741,7 +741,7 @@ func TestPushNotificationAck(t *testing.T) {
handler := api.ApiHandler(pushNotificationAck)
resp := httptest.NewRecorder()
req := httptest.NewRequest("POST", "/api/v4/notifications/ack", nil)
req.Header.Set(model.HEADER_AUTH, "Bearer "+session.Token)
req.Header.Set(model.HeaderAuth, "Bearer "+session.Token)
handler.ServeHTTP(resp, req)
assert.Equal(t, http.StatusBadRequest, resp.Code)