24 lines
603 B
Go
24 lines
603 B
Go
package cache_test
|
|
|
|
import (
|
|
"fmt"
|
|
"go_dreamfactory/sys/cache"
|
|
"go_dreamfactory/sys/db"
|
|
"os"
|
|
"testing"
|
|
)
|
|
|
|
func TestMain(m *testing.M) {
|
|
if err := db.OnInit(nil, db.Set_MongodbUrl("mongodb://admin:123456@10.0.0.9:27018"), db.Set_MongodbDatabase("dreamfactory")); err != nil {
|
|
fmt.Printf("err:%v\n", err)
|
|
return
|
|
}
|
|
if err := cache.OnInit(nil, cache.Set_Redis_Addr([]string{"10.0.0.9:9001", "10.0.0.9:9002", "10.0.0.9:9003", "10.0.1.45:9004", "10.0.1.45:9005", "10.0.1.45:9006"}), cache.Set_Redis_Password("")); err != nil {
|
|
fmt.Printf("err:%v\n", err)
|
|
return
|
|
}
|
|
|
|
defer os.Exit(m.Run())
|
|
|
|
}
|