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>
This commit is contained in:
Sofia Papagiannaki
2020-10-16 10:46:14 +03:00
committed by GitHub
co-authored by Emil Tullstedt
parent c07896063b
commit 4937f0daab
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
}