github.com/masterhung0112/hk_server/v5@v5.0.0-20220302090640-ec71aef15e1c/services/users/main_test.go (about) 1 // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. 2 // See LICENSE.txt for license information. 3 4 package users 5 6 import ( 7 "flag" 8 "testing" 9 10 "github.com/masterhung0112/hk_server/v5/shared/mlog" 11 "github.com/masterhung0112/hk_server/v5/testlib" 12 ) 13 14 var mainHelper *testlib.MainHelper 15 var replicaFlag bool 16 17 func TestMain(m *testing.M) { 18 if f := flag.Lookup("mysql-replica"); f == nil { 19 flag.BoolVar(&replicaFlag, "mysql-replica", false, "") 20 flag.Parse() 21 } 22 23 var options = testlib.HelperOptions{ 24 EnableStore: true, 25 EnableResources: true, 26 WithReadReplica: replicaFlag, 27 } 28 29 mlog.DisableZap() 30 31 mainHelper = testlib.NewMainHelperWithOptions(&options) 32 defer mainHelper.Close() 33 34 mainHelper.Main(m) 35 }