1
- //go:build integration
2
- // +build integration
3
-
4
1
package database
5
2
6
3
import (
@@ -246,7 +243,7 @@ func TestIntegrationDashboardDataAccess(t *testing.T) {
246
243
require .NoError (t , err )
247
244
require .Equal (t , len (res ), 0 )
248
245
249
- sqlStore .WithDbSession (context .Background (), func (sess * sqlstore.DBSession ) error {
246
+ err = sqlStore .WithDbSession (context .Background (), func (sess * sqlstore.DBSession ) error {
250
247
var existingRuleID int64
251
248
exists , err := sess .Table ("alert_rule" ).Where ("namespace_uid = (SELECT uid FROM dashboard WHERE id = ?)" , savedFolder .Id ).Cols ("id" ).Get (& existingRuleID )
252
249
require .NoError (t , err )
@@ -259,6 +256,7 @@ func TestIntegrationDashboardDataAccess(t *testing.T) {
259
256
260
257
return nil
261
258
})
259
+ require .NoError (t , err )
262
260
})
263
261
264
262
t .Run ("Should return error if no dashboard is found for update when dashboard id is greater than zero" , func (t * testing.T ) {
@@ -541,7 +539,6 @@ func TestIntegrationDashboard_SortingOptions(t *testing.T) {
541
539
require .Len (t , results , 2 )
542
540
assert .Equal (t , dashB .Id , results [0 ].ID )
543
541
assert .Equal (t , dashA .Id , results [1 ].ID )
544
-
545
542
}
546
543
547
544
func TestIntegrationDashboard_Filter (t * testing.T ) {
@@ -583,11 +580,10 @@ func TestIntegrationDashboard_Filter(t *testing.T) {
583
580
require .NoError (t , err )
584
581
require .Len (t , results , 1 )
585
582
assert .Equal (t , dashB .Id , results [0 ].ID )
586
-
587
583
}
588
584
589
585
func insertTestRule (t * testing.T , sqlStore * sqlstore.SQLStore , foderOrgID int64 , folderUID string ) {
590
- sqlStore .WithDbSession (context .Background (), func (sess * sqlstore.DBSession ) error {
586
+ err := sqlStore .WithDbSession (context .Background (), func (sess * sqlstore.DBSession ) error {
591
587
type alertQuery struct {
592
588
RefID string
593
589
DatasourceUID string
@@ -656,6 +652,7 @@ func insertTestRule(t *testing.T, sqlStore *sqlstore.SQLStore, foderOrgID int64,
656
652
require .NoError (t , err )
657
653
return err
658
654
})
655
+ require .NoError (t , err )
659
656
}
660
657
661
658
func CreateUser (t * testing.T , sqlStore * sqlstore.SQLStore , name string , role string , isAdmin bool ) models.User {
0 commit comments