xorm/engine_group_test.go
Lunny Xiao c56c8e122a
All checks were successful
continuous-integration/drone/push Build is passing
Fix master/slave bug (#1601)
fix test

Fix master/slave bug

Reviewed-on: #1601
2020-03-13 00:42:01 +00:00

34 lines
734 B
Go

// Copyright 2020 The Xorm Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package xorm
import (
"testing"
"github.com/stretchr/testify/assert"
"xorm.io/xorm/log"
"xorm.io/xorm/schemas"
)
func TestEngineGroup(t *testing.T) {
assert.NoError(t, prepareEngine())
master := testEngine.(*Engine)
if master.Dialect().URI().DBType == schemas.SQLITE {
t.Skip()
return
}
eg, err := NewEngineGroup(master, []*Engine{master})
assert.NoError(t, err)
eg.SetMaxIdleConns(10)
eg.SetMaxOpenConns(100)
eg.SetTableMapper(master.GetTableMapper())
eg.SetColumnMapper(master.GetColumnMapper())
eg.SetLogLevel(log.LOG_INFO)
eg.ShowSQL(true)
}