mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-05 20:11:14 +08:00
update test method args.
This commit is contained in:
parent
7859f2ccb3
commit
268e1df168
@ -46,7 +46,7 @@ func TestName(t *testing.T) {
|
|||||||
|
|
||||||
srv := &cronServer{
|
srv := &cronServer{
|
||||||
ctx: ctx,
|
ctx: ctx,
|
||||||
config: &CronTaskConfig{
|
config: &Config{
|
||||||
CronTask: config.CronTask{
|
CronTask: config.CronTask{
|
||||||
RetainChatRecords: 1,
|
RetainChatRecords: 1,
|
||||||
FileExpireTime: 1,
|
FileExpireTime: 1,
|
||||||
|
@ -10,7 +10,7 @@ import (
|
|||||||
func TestLoadLogConfig(t *testing.T) {
|
func TestLoadLogConfig(t *testing.T) {
|
||||||
var log Log
|
var log Log
|
||||||
os.Setenv("IMENV_LOG_REMAINLOGLEVEL", "5")
|
os.Setenv("IMENV_LOG_REMAINLOGLEVEL", "5")
|
||||||
err := Load("../../../config/", "log.yml", "IMENV_LOG", "source", &log)
|
err := Load("../../../config/", "log.yml", "IMENV_LOG", &log)
|
||||||
assert.Nil(t, err)
|
assert.Nil(t, err)
|
||||||
t.Log(log.RemainLogLevel)
|
t.Log(log.RemainLogLevel)
|
||||||
// assert.Equal(t, "../../../../logs/", log.StorageLocation)
|
// assert.Equal(t, "../../../../logs/", log.StorageLocation)
|
||||||
@ -22,7 +22,7 @@ func TestLoadMongoConfig(t *testing.T) {
|
|||||||
os.Setenv("IMENV_MONGODB_PASSWORD", "openIM1231231")
|
os.Setenv("IMENV_MONGODB_PASSWORD", "openIM1231231")
|
||||||
// os.Setenv("IMENV_MONGODB_URI", "openIM123")
|
// os.Setenv("IMENV_MONGODB_URI", "openIM123")
|
||||||
// os.Setenv("IMENV_MONGODB_USERNAME", "openIM123")
|
// os.Setenv("IMENV_MONGODB_USERNAME", "openIM123")
|
||||||
err := Load("../../../config/", "mongodb.yml", "IMENV_MONGODB", "source", &mongo)
|
err := Load("../../../config/", "mongodb.yml", "IMENV_MONGODB", &mongo)
|
||||||
// err := LoadApiConfig("../../../config/mongodb.yml", "IMENV_MONGODB", &mongo)
|
// err := LoadApiConfig("../../../config/mongodb.yml", "IMENV_MONGODB", &mongo)
|
||||||
|
|
||||||
assert.Nil(t, err)
|
assert.Nil(t, err)
|
||||||
@ -38,14 +38,14 @@ func TestLoadMongoConfig(t *testing.T) {
|
|||||||
|
|
||||||
func TestLoadMinioConfig(t *testing.T) {
|
func TestLoadMinioConfig(t *testing.T) {
|
||||||
var storageConfig Minio
|
var storageConfig Minio
|
||||||
err := Load("../../../config/minio.yml", "IMENV_MINIO", "", "source", &storageConfig)
|
err := Load("../../../config/minio.yml", "IMENV_MINIO", "", &storageConfig)
|
||||||
assert.Nil(t, err)
|
assert.Nil(t, err)
|
||||||
assert.Equal(t, "openim", storageConfig.Bucket)
|
assert.Equal(t, "openim", storageConfig.Bucket)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestLoadWebhooksConfig(t *testing.T) {
|
func TestLoadWebhooksConfig(t *testing.T) {
|
||||||
var webhooks Webhooks
|
var webhooks Webhooks
|
||||||
err := Load("../../../config/webhooks.yml", "IMENV_WEBHOOKS", "", "source", &webhooks)
|
err := Load("../../../config/webhooks.yml", "IMENV_WEBHOOKS", "", &webhooks)
|
||||||
assert.Nil(t, err)
|
assert.Nil(t, err)
|
||||||
assert.Equal(t, 5, webhooks.BeforeAddBlack.Timeout)
|
assert.Equal(t, 5, webhooks.BeforeAddBlack.Timeout)
|
||||||
|
|
||||||
@ -53,7 +53,7 @@ func TestLoadWebhooksConfig(t *testing.T) {
|
|||||||
|
|
||||||
func TestLoadOpenIMRpcUserConfig(t *testing.T) {
|
func TestLoadOpenIMRpcUserConfig(t *testing.T) {
|
||||||
var user User
|
var user User
|
||||||
err := Load("../../../config/openim-rpc-user.yml", "IMENV_OPENIM_RPC_USER", "", "source", &user)
|
err := Load("../../../config/openim-rpc-user.yml", "IMENV_OPENIM_RPC_USER", "", &user)
|
||||||
assert.Nil(t, err)
|
assert.Nil(t, err)
|
||||||
//export IMENV_OPENIM_RPC_USER_RPC_LISTENIP="0.0.0.0"
|
//export IMENV_OPENIM_RPC_USER_RPC_LISTENIP="0.0.0.0"
|
||||||
assert.Equal(t, "0.0.0.0", user.RPC.ListenIP)
|
assert.Equal(t, "0.0.0.0", user.RPC.ListenIP)
|
||||||
@ -63,14 +63,14 @@ func TestLoadOpenIMRpcUserConfig(t *testing.T) {
|
|||||||
|
|
||||||
func TestLoadNotificationConfig(t *testing.T) {
|
func TestLoadNotificationConfig(t *testing.T) {
|
||||||
var noti Notification
|
var noti Notification
|
||||||
err := Load("../../../config/notification.yml", "IMENV_NOTIFICATION", "", "source", ¬i)
|
err := Load("../../../config/notification.yml", "IMENV_NOTIFICATION", "", ¬i)
|
||||||
assert.Nil(t, err)
|
assert.Nil(t, err)
|
||||||
assert.Equal(t, "Your friend's profile has been changed", noti.FriendRemarkSet.OfflinePush.Title)
|
assert.Equal(t, "Your friend's profile has been changed", noti.FriendRemarkSet.OfflinePush.Title)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestLoadOpenIMThirdConfig(t *testing.T) {
|
func TestLoadOpenIMThirdConfig(t *testing.T) {
|
||||||
var third Third
|
var third Third
|
||||||
err := Load("../../../config/openim-rpc-third.yml", "IMENV_OPENIM_RPC_THIRD", "", "source", &third)
|
err := Load("../../../config/openim-rpc-third.yml", "IMENV_OPENIM_RPC_THIRD", "", &third)
|
||||||
assert.Nil(t, err)
|
assert.Nil(t, err)
|
||||||
assert.Equal(t, "enabled", third.Object.Enable)
|
assert.Equal(t, "enabled", third.Object.Enable)
|
||||||
assert.Equal(t, "https://oss-cn-chengdu.aliyuncs.com", third.Object.Oss.Endpoint)
|
assert.Equal(t, "https://oss-cn-chengdu.aliyuncs.com", third.Object.Oss.Endpoint)
|
||||||
@ -86,7 +86,7 @@ func TestLoadOpenIMThirdConfig(t *testing.T) {
|
|||||||
|
|
||||||
func TestTransferConfig(t *testing.T) {
|
func TestTransferConfig(t *testing.T) {
|
||||||
var tran MsgTransfer
|
var tran MsgTransfer
|
||||||
err := Load("../../../config/openim-msgtransfer.yml", "IMENV_OPENIM-MSGTRANSFER", "", "source", &tran)
|
err := Load("../../../config/openim-msgtransfer.yml", "IMENV_OPENIM-MSGTRANSFER", "", &tran)
|
||||||
assert.Nil(t, err)
|
assert.Nil(t, err)
|
||||||
assert.Equal(t, true, tran.Prometheus.Enable)
|
assert.Equal(t, true, tran.Prometheus.Enable)
|
||||||
assert.Equal(t, true, tran.Prometheus.AutoSetPorts)
|
assert.Equal(t, true, tran.Prometheus.AutoSetPorts)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user