mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
MM-21520: Remove temporary databases after tests run (#13572)
* MM-21520: Remove temorary databases after tests run * accidental test name change Co-authored-by: mattermod <mattermod@users.noreply.github.com>
This commit is contained in:
committed by
Jesús Espino
parent
0361e8b97e
commit
5f7ca55b13
@@ -7,6 +7,7 @@ import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/mattermost/mattermost-server/v5/store/storetest"
|
||||
"github.com/mattermost/mattermost-server/v5/testlib"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
@@ -15,6 +16,7 @@ import (
|
||||
func TestMigrateDatabaseToFile(t *testing.T) {
|
||||
helper := testlib.NewMainHelper()
|
||||
sqlSettings := helper.GetSqlSettings()
|
||||
defer storetest.CleanupSqlSettings(sqlSettings)
|
||||
sqlDSN := fmt.Sprintf("%s://%s", *sqlSettings.DriverName, *sqlSettings.DataSource)
|
||||
fileDSN := "config.json"
|
||||
files := []string{"IdpCertificateFile", "PublicCertificateFile", "PrivateKeyFile"}
|
||||
@@ -53,6 +55,7 @@ func TestMigrateDatabaseToFile(t *testing.T) {
|
||||
func TestMigrateFileToDatabaseWhenFilePathIsNotSpecified(t *testing.T) {
|
||||
helper := testlib.NewMainHelper()
|
||||
sqlSettings := helper.GetSqlSettings()
|
||||
defer storetest.CleanupSqlSettings(sqlSettings)
|
||||
sqlDSN := fmt.Sprintf("%s://%s", *sqlSettings.DriverName, *sqlSettings.DataSource)
|
||||
fileDSN := "config.json"
|
||||
|
||||
|
||||
@@ -91,6 +91,9 @@ func tearDownStores() {
|
||||
if st.Store != nil {
|
||||
st.Store.Close()
|
||||
}
|
||||
if st.SqlSettings != nil {
|
||||
storetest.CleanupSqlSettings(st.SqlSettings)
|
||||
}
|
||||
wg.Done()
|
||||
}()
|
||||
}
|
||||
|
||||
@@ -90,6 +90,9 @@ func tearDownStores() {
|
||||
if st.Store != nil {
|
||||
st.Store.Close()
|
||||
}
|
||||
if st.SqlSettings != nil {
|
||||
storetest.CleanupSqlSettings(st.SqlSettings)
|
||||
}
|
||||
wg.Done()
|
||||
}()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user