SQLStore: Run tests as integration tests (#28265)

* sqlstore: Run tests as integration tests

* Truncate database instead of re-creating it on each test

* Fix test description

See https://github.com/grafana/grafana/pull/12129

* Fix lint issues

* Fix postgres dialect after review suggestion

* Rename and document functions after review suggestion

* Add periods

* Fix auto-increment value for mysql dialect

Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
(cherry picked from commit 4937f0daab)
This commit is contained in:
Sofia Papagiannaki
2020-10-22 12:47:29 +02:00
committed by Arve Knudsen
parent 77ab9f4331
commit e5f12afda2
33 changed files with 222 additions and 53 deletions
@@ -45,6 +45,7 @@ type Dialect interface {
PostInsertId(table string, sess *xorm.Session) error
CleanDB() error
TruncateDBTables() error
NoOpSql() string
IsUniqueConstraintViolation(err error) bool
@@ -270,3 +271,7 @@ func (db *BaseDialect) CleanDB() error {
func (db *BaseDialect) NoOpSql() string {
return "SELECT 0;"
}
func (db *BaseDialect) TruncateDBTables() error {
return nil
}