Preparation for using an embedded database #55

This commit is contained in:
Michael Mayer 2018-11-09 19:06:03 +01:00
parent 90d73e4a61
commit 53dfd1647a
4 changed files with 9 additions and 3 deletions

View file

@ -14,8 +14,8 @@ before_script:
- docker-compose -f docker-compose.travis.yml up -d --build
script:
- if [ "$TRAVIS_BRANCH" == "develop" ]; then docker-compose -f docker-compose.travis.yml exec photoprism make all migrate test-codecov; fi
- if [ "$TRAVIS_BRANCH" != "develop" ]; then docker-compose -f docker-compose.travis.yml exec photoprism make all migrate test; fi
- if [ "$TRAVIS_BRANCH" == "develop" ]; then docker-compose -f docker-compose.travis.yml exec photoprism make all install migrate test-codecov; fi
- if [ "$TRAVIS_BRANCH" != "develop" ]; then docker-compose -f docker-compose.travis.yml exec photoprism make all install migrate test; fi
after_script:
- docker-compose -f docker-compose.travis.yml down

2
assets/database/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
*
!.gitignore

View file

@ -8,7 +8,6 @@ import (
"time"
"github.com/jinzhu/gorm"
_ "github.com/jinzhu/gorm/dialects/mssql" // Import gorm drivers
_ "github.com/jinzhu/gorm/dialects/mysql"
_ "github.com/jinzhu/gorm/dialects/postgres"
_ "github.com/jinzhu/gorm/dialects/sqlite"

View file

@ -32,6 +32,11 @@ var exportPath = GetExpandedFilename(testDataPath + "/export")
var databaseDriver = "mysql"
var databaseDsn = "photoprism:photoprism@tcp(database:3306)/photoprism?parseTime=true"
func init() {
conf := NewTestConfig()
conf.MigrateDb()
}
func (c *Config) RemoveTestData(t *testing.T) {
os.RemoveAll(c.ImportPath)
os.RemoveAll(c.ExportPath)