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
+3 -1
View File
@@ -1,3 +1,5 @@
// +build integration
package sqlstore
import (
@@ -128,7 +130,7 @@ func TestAlertingDataAccess(t *testing.T) {
So(alert.DashboardSlug, ShouldEqual, "dashboard-with-alerts")
})
Convey("Viewer cannot read alerts", func() {
Convey("Viewer can read alerts", func() {
viewerUser := &models.SignedInUser{OrgRole: models.ROLE_VIEWER, OrgId: 1}
alertQuery := models.GetAlertsQuery{DashboardIDs: []int64{testDash.Id}, PanelId: 1, OrgId: 1, User: viewerUser}
err2 := HandleAlertsQuery(&alertQuery)