29
30
// SetupSuiteBase sets up the test suite
31
>
func (tb *SetupSchemaTestBase) SetupSuiteBase(db DB, pluginName string, conn ConnectParams) {
setuptest.go
32
>
tb.conn = conn
33
>
tb.Assertions = require.New(tb.T()) // Have to define our overridden assertions in the test setup. If we did it earlier, tb.T() will return nil
34
>
tb.Logger = log.NewTestLogger()
35
>
tb.rand = rand.New(rand.NewSource(time.Now().UnixNano()))
36
>
tb.DBName = fmt.Sprintf("setup_test_%v", tb.rand.Int63())
37
>
err := db.CreateDatabase(tb.DBName)
38
>
if err != nil {
39
tb.Logger.Fatal("error creating database, ", tag.Error(err))
40
}
42
>
tb.pluginName = pluginName
43
}
44
45
// TearDownSuiteBase tears down the test suite
46
>
func (tb *SetupSchemaTestBase) TearDownSuiteBase() {
setuptest.go
47
>
tb.NoError(tb.db.DropDatabase(tb.DBName))
48
>
tb.db.Close()
49
>
}
50
51
// RunSetupTest exercises the SetupSchema task