mysql: mysql tests should use a db server with UTC
To get rid of issues involving date/time when testing. Also, makes it possible to run mysql integration tests for both grafana config db and tsdb at the same time using GRAFANA_TEST_DB=mysql go test ./pkg/...
This commit is contained in:
@@ -258,7 +258,7 @@ func InitTestDB(t *testing.T) *xorm.Engine {
|
||||
// x.ShowSQL()
|
||||
|
||||
if err != nil {
|
||||
t.Fatalf("Failed to init in memory sqllite3 db %v", err)
|
||||
t.Fatalf("Failed to init test database: %v", err)
|
||||
}
|
||||
|
||||
sqlutil.CleanDB(x)
|
||||
@@ -269,3 +269,12 @@ func InitTestDB(t *testing.T) *xorm.Engine {
|
||||
|
||||
return x
|
||||
}
|
||||
|
||||
func IsTestDbMySql() bool {
|
||||
if db, present := os.LookupEnv("GRAFANA_TEST_DB"); present {
|
||||
return db == dbMySql
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user