fix: persistence tests were not being properly initialized

This commit is contained in:
Deluan
2020-01-26 17:10:13 -05:00
parent 7c2728aadc
commit 0ff741b394
3 changed files with 20 additions and 28 deletions
+6 -4
View File
@@ -9,11 +9,13 @@ import (
"github.com/deluan/navidrome/conf"
"github.com/deluan/navidrome/log"
"github.com/deluan/navidrome/model"
"github.com/deluan/navidrome/tests"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
func TestPersistence(t *testing.T) {
tests.Init(t, true)
log.SetLevel(log.LevelCritical)
RegisterFailHandler(Fail)
RunSpecs(t, "Persistence Suite")
@@ -59,14 +61,14 @@ func P(path string) string {
var _ = Describe("Initialize test DB", func() {
BeforeSuite(func() {
//log.SetLevel(log.LevelTrace)
//conf.Server.DbPath, _ = ioutil.TempDir("", "navidrome_tests")
//os.MkdirAll(conf.Server.DbPath, 0700)
conf.Server.DbPath = ":memory:"
ds := New()
artistRepo := ds.Artist()
for _, a := range testArtists {
artistRepo.Put(&a)
err := artistRepo.Put(&a)
if err != nil {
panic(err)
}
}
albumRepository := ds.Album()
for _, a := range testAlbums {