You've already forked focalboard
mirror of
https://github.com/mattermost/focalboard.git
synced 2025-09-16 08:56:19 +02:00
Revert in-memory unit tests for sqlite (#2630)
* revert in-memory unit tests for sqlite * fix unit test * fix comments * fix unit tests
This commit is contained in:
@@ -27,7 +27,9 @@ func New(store permissions.Store, logger *mlog.Logger) *Service {
|
||||
}
|
||||
|
||||
func (s *Service) HasPermissionToTeam(userID, teamID string, permission *mmModel.Permission) bool {
|
||||
// Locally there is no team, so return true
|
||||
if userID == "" || teamID == "" || permission == nil {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
|
@@ -3,6 +3,7 @@ package sqlstore
|
||||
import (
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
@@ -33,7 +34,12 @@ func PrepareNewTestDatabase() (dbType string, connectionString string, err error
|
||||
var rootUser string
|
||||
|
||||
if dbType == model.SqliteDBType {
|
||||
connectionString = "file::memory:?cache=shared&_busy_timeout=5000"
|
||||
file, err := ioutil.TempFile("", "fbtest_*.db")
|
||||
if err != nil {
|
||||
return "", "", err
|
||||
}
|
||||
connectionString = file.Name() + "?_busy_timeout=5000"
|
||||
_ = file.Close()
|
||||
} else if port := strings.TrimSpace(os.Getenv("FB_STORE_TEST_DOCKER_PORT")); port != "" {
|
||||
// docker unit tests take priority over any DSN env vars
|
||||
var template string
|
||||
|
Reference in New Issue
Block a user