Chore: Run integration tests without grabpl (#49448)
* Chore: Run integration tests without grabpl * Add new step for integration tests in lib.star * Remove old integration test step from lib.star * Change drone signature * Fix: Edit starlark integration step to not affect enterprise * Remove all build tags & rename starlark integration test step * Resync .drone.yml with .drone.star * Fix lint errors * Fix lint errors * Fix lint errors * Fix more lint errors * Fix another lint error * Rename integration test step * Fix last lint error * Recomment enterprise step * Remove comment from Makefile Co-authored-by: Ida Furjesova <ida.furjesova@grafana.com>
This commit is contained in:
co-authored by
Ida Furjesova
parent
2edfbb7767
commit
c63ebc887b
@@ -1,6 +1,3 @@
|
||||
//go:build integration
|
||||
// +build integration
|
||||
|
||||
package database
|
||||
|
||||
import (
|
||||
@@ -246,7 +243,7 @@ func TestIntegrationDashboardDataAccess(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, len(res), 0)
|
||||
|
||||
sqlStore.WithDbSession(context.Background(), func(sess *sqlstore.DBSession) error {
|
||||
err = sqlStore.WithDbSession(context.Background(), func(sess *sqlstore.DBSession) error {
|
||||
var existingRuleID int64
|
||||
exists, err := sess.Table("alert_rule").Where("namespace_uid = (SELECT uid FROM dashboard WHERE id = ?)", savedFolder.Id).Cols("id").Get(&existingRuleID)
|
||||
require.NoError(t, err)
|
||||
@@ -259,6 +256,7 @@ func TestIntegrationDashboardDataAccess(t *testing.T) {
|
||||
|
||||
return nil
|
||||
})
|
||||
require.NoError(t, err)
|
||||
})
|
||||
|
||||
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) {
|
||||
require.Len(t, results, 2)
|
||||
assert.Equal(t, dashB.Id, results[0].ID)
|
||||
assert.Equal(t, dashA.Id, results[1].ID)
|
||||
|
||||
}
|
||||
|
||||
func TestIntegrationDashboard_Filter(t *testing.T) {
|
||||
@@ -583,11 +580,10 @@ func TestIntegrationDashboard_Filter(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
require.Len(t, results, 1)
|
||||
assert.Equal(t, dashB.Id, results[0].ID)
|
||||
|
||||
}
|
||||
|
||||
func insertTestRule(t *testing.T, sqlStore *sqlstore.SQLStore, foderOrgID int64, folderUID string) {
|
||||
sqlStore.WithDbSession(context.Background(), func(sess *sqlstore.DBSession) error {
|
||||
err := sqlStore.WithDbSession(context.Background(), func(sess *sqlstore.DBSession) error {
|
||||
type alertQuery struct {
|
||||
RefID string
|
||||
DatasourceUID string
|
||||
@@ -656,6 +652,7 @@ func insertTestRule(t *testing.T, sqlStore *sqlstore.SQLStore, foderOrgID int64,
|
||||
require.NoError(t, err)
|
||||
return err
|
||||
})
|
||||
require.NoError(t, err)
|
||||
}
|
||||
|
||||
func CreateUser(t *testing.T, sqlStore *sqlstore.SQLStore, name string, role string, isAdmin bool) models.User {
|
||||
|
||||
Reference in New Issue
Block a user