2020-01-15 23:49:09 +01:00
|
|
|
package engine
|
|
|
|
|
|
|
|
import (
|
2020-04-06 02:31:05 +02:00
|
|
|
"io/ioutil"
|
|
|
|
"os"
|
2020-01-15 23:49:09 +01:00
|
|
|
"testing"
|
|
|
|
|
2020-01-24 01:44:08 +01:00
|
|
|
"github.com/deluan/navidrome/log"
|
2020-02-03 17:54:59 +01:00
|
|
|
"github.com/deluan/navidrome/tests"
|
2020-04-06 02:31:05 +02:00
|
|
|
"github.com/djherbis/fscache"
|
2020-01-15 23:49:09 +01:00
|
|
|
. "github.com/onsi/ginkgo"
|
|
|
|
. "github.com/onsi/gomega"
|
|
|
|
)
|
|
|
|
|
2020-01-16 03:52:50 +01:00
|
|
|
func TestEngine(t *testing.T) {
|
2020-02-03 17:54:59 +01:00
|
|
|
tests.Init(t, false)
|
2020-01-15 23:49:09 +01:00
|
|
|
log.SetLevel(log.LevelCritical)
|
|
|
|
RegisterFailHandler(Fail)
|
2020-01-16 03:52:50 +01:00
|
|
|
RunSpecs(t, "Engine Suite")
|
2020-01-15 23:49:09 +01:00
|
|
|
}
|
2020-04-06 02:31:05 +02:00
|
|
|
|
|
|
|
var testCache fscache.Cache
|
|
|
|
var testCacheDir string
|
|
|
|
|
|
|
|
var _ = Describe("Engine Suite Setup", func() {
|
|
|
|
BeforeSuite(func() {
|
2020-04-09 19:15:01 +02:00
|
|
|
testCacheDir, _ = ioutil.TempDir("", "engine_test_cache")
|
2020-04-06 02:31:05 +02:00
|
|
|
fs, _ := fscache.NewFs(testCacheDir, 0755)
|
|
|
|
testCache, _ = fscache.NewCache(fs, nil)
|
|
|
|
})
|
|
|
|
|
|
|
|
AfterSuite(func() {
|
|
|
|
os.RemoveAll(testCacheDir)
|
|
|
|
})
|
|
|
|
})
|