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