Marking when user ran the unit tests
Этот коммит содержится в:
@@ -16,17 +16,18 @@ import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/go-gorp/gorp"
|
||||
_ "github.com/go-sql-driver/mysql"
|
||||
_ "github.com/lib/pq"
|
||||
"github.com/mattermost/platform/model"
|
||||
"github.com/mattermost/platform/utils"
|
||||
"io"
|
||||
sqltrace "log"
|
||||
"math/rand"
|
||||
"os"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/go-gorp/gorp"
|
||||
_ "github.com/go-sql-driver/mysql"
|
||||
_ "github.com/lib/pq"
|
||||
"github.com/mattermost/platform/model"
|
||||
"github.com/mattermost/platform/utils"
|
||||
)
|
||||
|
||||
type SqlStore struct {
|
||||
@@ -179,6 +180,17 @@ func (ss SqlStore) GetCurrentSchemaVersion() string {
|
||||
return version
|
||||
}
|
||||
|
||||
func (ss SqlStore) MarkSystemRanUnitTests() {
|
||||
if result := <-ss.System().Get(); result.Err == nil {
|
||||
props := result.Data.(model.StringMap)
|
||||
unitTests := props[model.SYSTEM_RAN_UNIT_TESTS]
|
||||
if len(unitTests) == 0 {
|
||||
systemTests := &model.System{Name: model.SYSTEM_RAN_UNIT_TESTS, Value: "1"}
|
||||
<-ss.System().Save(systemTests)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (ss SqlStore) DoesTableExist(tableName string) bool {
|
||||
if utils.Cfg.SqlSettings.DriverName == model.DATABASE_DRIVER_POSTGRES {
|
||||
count, err := ss.GetMaster().SelectInt(
|
||||
|
||||
Ссылка в новой задаче
Block a user