Chore: Rename integration tests (#49438)
* Chore: Rename integration tests * Remove one Integration Co-authored-by: Ida Furjesova <ida.furjesova@grafana.com>
This commit is contained in:
co-authored by
Ida Furjesova
parent
7bcc151ae6
commit
50c2b4682a
@@ -16,7 +16,7 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestAlertNotificationSQLAccess(t *testing.T) {
|
||||
func TestIntegrationAlertNotificationSQLAccess(t *testing.T) {
|
||||
var sqlStore *SQLStore
|
||||
setup := func() { sqlStore = InitTestDB(t) }
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ func resetTimeNow() {
|
||||
timeNow = time.Now
|
||||
}
|
||||
|
||||
func TestAlertingDataAccess(t *testing.T) {
|
||||
func TestIntegrationAlertingDataAccess(t *testing.T) {
|
||||
mockTimeNow()
|
||||
defer resetTimeNow()
|
||||
|
||||
@@ -262,7 +262,7 @@ func TestAlertingDataAccess(t *testing.T) {
|
||||
})
|
||||
}
|
||||
|
||||
func TestPausingAlerts(t *testing.T) {
|
||||
func TestIntegrationPausingAlerts(t *testing.T) {
|
||||
mockTimeNow()
|
||||
defer resetTimeNow()
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ import (
|
||||
"github.com/grafana/grafana/pkg/services/sqlstore"
|
||||
)
|
||||
|
||||
func TestAnnotations(t *testing.T) {
|
||||
func TestIntegrationAnnotations(t *testing.T) {
|
||||
sql := sqlstore.InitTestDB(t)
|
||||
repo := sqlstore.NewSQLAnnotationRepo(sql)
|
||||
|
||||
@@ -382,7 +382,7 @@ func TestAnnotations(t *testing.T) {
|
||||
})
|
||||
}
|
||||
|
||||
func TestAnnotationListingWithRBAC(t *testing.T) {
|
||||
func TestIntegrationAnnotationListingWithRBAC(t *testing.T) {
|
||||
sql := sqlstore.InitTestDB(t, sqlstore.InitTestDBOpt{})
|
||||
repo := sqlstore.NewSQLAnnotationRepo(sql)
|
||||
dashboardStore := dashboardstore.ProvideDashboardStore(sql)
|
||||
|
||||
@@ -16,7 +16,7 @@ import (
|
||||
"github.com/grafana/grafana/pkg/services/accesscontrol"
|
||||
)
|
||||
|
||||
func TestApiKeyDataAccess(t *testing.T) {
|
||||
func TestIntegrationApiKeyDataAccess(t *testing.T) {
|
||||
mockTimeNow()
|
||||
defer resetTimeNow()
|
||||
|
||||
@@ -137,7 +137,7 @@ func TestApiKeyDataAccess(t *testing.T) {
|
||||
})
|
||||
}
|
||||
|
||||
func TestApiKeyErrors(t *testing.T) {
|
||||
func TestIntegrationApiKeyErrors(t *testing.T) {
|
||||
mockTimeNow()
|
||||
defer resetTimeNow()
|
||||
|
||||
@@ -173,7 +173,7 @@ type getApiKeysTestCase struct {
|
||||
expectedNumKeys int
|
||||
}
|
||||
|
||||
func TestSQLStore_GetAPIKeys(t *testing.T) {
|
||||
func TestIntegrationSQLStore_GetAPIKeys(t *testing.T) {
|
||||
tests := []getApiKeysTestCase{
|
||||
{
|
||||
desc: "expect all keys for wildcard scope",
|
||||
|
||||
@@ -17,7 +17,7 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestDashboardSnapshotDBAccess(t *testing.T) {
|
||||
func TestIntegrationDashboardSnapshotDBAccess(t *testing.T) {
|
||||
sqlstore := InitTestDB(t)
|
||||
|
||||
origSecret := setting.SecretKey
|
||||
@@ -144,7 +144,7 @@ func TestDashboardSnapshotDBAccess(t *testing.T) {
|
||||
})
|
||||
}
|
||||
|
||||
func TestDeleteExpiredSnapshots(t *testing.T) {
|
||||
func TestIntegrationDeleteExpiredSnapshots(t *testing.T) {
|
||||
sqlstore := InitTestDB(t)
|
||||
|
||||
t.Run("Testing dashboard snapshots clean up", func(t *testing.T) {
|
||||
|
||||
@@ -14,7 +14,7 @@ import (
|
||||
var theme = models.ThemeDark
|
||||
var kind = models.ThumbnailKindDefault
|
||||
|
||||
func TestSqlStorage(t *testing.T) {
|
||||
func TestIntegrationSqlStorage(t *testing.T) {
|
||||
|
||||
var sqlStore *SQLStore
|
||||
var savedFolder *models.Dashboard
|
||||
|
||||
@@ -78,7 +78,7 @@ func updateTestDashboard(t *testing.T, sqlStore *SQLStore, dashboard *models.Das
|
||||
require.NoError(t, err)
|
||||
}
|
||||
|
||||
func TestGetDashboardVersion(t *testing.T) {
|
||||
func TestIntegrationGetDashboardVersion(t *testing.T) {
|
||||
sqlStore := InitTestDB(t)
|
||||
|
||||
t.Run("Get a Dashboard ID and version ID", func(t *testing.T) {
|
||||
@@ -118,7 +118,7 @@ func TestGetDashboardVersion(t *testing.T) {
|
||||
})
|
||||
}
|
||||
|
||||
func TestGetDashboardVersions(t *testing.T) {
|
||||
func TestIntegrationGetDashboardVersions(t *testing.T) {
|
||||
sqlStore := InitTestDB(t)
|
||||
savedDash := insertTestDashboard(t, sqlStore, "test dash 43", 1, 0, false, "diff-all")
|
||||
|
||||
@@ -151,7 +151,7 @@ func TestGetDashboardVersions(t *testing.T) {
|
||||
})
|
||||
}
|
||||
|
||||
func TestDeleteExpiredVersions(t *testing.T) {
|
||||
func TestIntegrationDeleteExpiredVersions(t *testing.T) {
|
||||
versionsToKeep := 5
|
||||
versionsToWrite := 10
|
||||
setting.DashboardVersionsToKeep = versionsToKeep
|
||||
|
||||
@@ -19,7 +19,7 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestDataAccess(t *testing.T) {
|
||||
func TestIntegrationDataAccess(t *testing.T) {
|
||||
defaultAddDatasourceCommand := models.AddDataSourceCommand{
|
||||
OrgId: 10,
|
||||
Name: "nisse",
|
||||
@@ -431,7 +431,7 @@ func TestDataAccess(t *testing.T) {
|
||||
})
|
||||
}
|
||||
|
||||
func TestGetDefaultDataSource(t *testing.T) {
|
||||
func TestIntegrationGetDefaultDataSource(t *testing.T) {
|
||||
InitTestDB(t)
|
||||
|
||||
t.Run("should return error if there is no default datasource", func(t *testing.T) {
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestGetDBHealthQuery(t *testing.T) {
|
||||
func TestIntegrationGetDBHealthQuery(t *testing.T) {
|
||||
store := InitTestDB(t)
|
||||
|
||||
query := models.GetDBHealthQuery{}
|
||||
|
||||
@@ -18,7 +18,7 @@ func mockTime(mock time.Time) time.Time {
|
||||
return mock
|
||||
}
|
||||
|
||||
func TestLoginAttempts(t *testing.T) {
|
||||
func TestIntegrationLoginAttempts(t *testing.T) {
|
||||
var beginningOfTime, timePlusOneMinute, timePlusTwoMinutes time.Time
|
||||
var sqlStore *SQLStore
|
||||
user := "user"
|
||||
|
||||
@@ -17,7 +17,7 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestAccountDataAccess(t *testing.T) {
|
||||
func TestIntegrationAccountDataAccess(t *testing.T) {
|
||||
t.Run("Testing Account DB Access", func(t *testing.T) {
|
||||
sqlStore := InitTestDB(t)
|
||||
testUser := &models.SignedInUser{
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestPlaylistDataAccess(t *testing.T) {
|
||||
func TestIntegrationPlaylistDataAccess(t *testing.T) {
|
||||
ss := InitTestDB(t)
|
||||
|
||||
t.Run("Can create playlist", func(t *testing.T) {
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestPluginSettings(t *testing.T) {
|
||||
func TestIntegrationPluginSettings(t *testing.T) {
|
||||
store := InitTestDB(t)
|
||||
|
||||
t.Run("Existing plugin settings", func(t *testing.T) {
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestQuotaCommandsAndQueries(t *testing.T) {
|
||||
func TestIntegrationQuotaCommandsAndQueries(t *testing.T) {
|
||||
sqlStore := InitTestDB(t)
|
||||
userId := int64(1)
|
||||
orgId := int64(0)
|
||||
|
||||
@@ -16,7 +16,7 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestSQLBuilder(t *testing.T) {
|
||||
func TestIntegrationSQLBuilder(t *testing.T) {
|
||||
t.Run("WriteDashboardPermissionFilter", func(t *testing.T) {
|
||||
t.Run("user ACL", func(t *testing.T) {
|
||||
test(t,
|
||||
|
||||
@@ -77,7 +77,7 @@ var sqlStoreTestCases = []sqlStoreTest{
|
||||
},
|
||||
}
|
||||
|
||||
func TestSQLConnectionString(t *testing.T) {
|
||||
func TestIntegrationSQLConnectionString(t *testing.T) {
|
||||
for _, testCase := range sqlStoreTestCases {
|
||||
t.Run(testCase.name, func(t *testing.T) {
|
||||
sqlstore := &SQLStore{}
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestStatsDataAccess(t *testing.T) {
|
||||
func TestIntegrationStatsDataAccess(t *testing.T) {
|
||||
sqlStore := InitTestDB(t)
|
||||
populateDB(t, sqlStore)
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestSavingTags(t *testing.T) {
|
||||
func TestIntegrationSavingTags(t *testing.T) {
|
||||
ss := InitTestDB(t)
|
||||
|
||||
tagPairs := []*models.Tag{
|
||||
|
||||
@@ -16,7 +16,7 @@ import (
|
||||
"github.com/grafana/grafana/pkg/services/serviceaccounts"
|
||||
)
|
||||
|
||||
func TestTeamCommandsAndQueries(t *testing.T) {
|
||||
func TestIntegrationTeamCommandsAndQueries(t *testing.T) {
|
||||
t.Run("Testing Team commands & queries", func(t *testing.T) {
|
||||
sqlStore := InitTestDB(t)
|
||||
testUser := &models.SignedInUser{
|
||||
@@ -401,7 +401,7 @@ func TestTeamCommandsAndQueries(t *testing.T) {
|
||||
})
|
||||
}
|
||||
|
||||
func TestSQLStore_SearchTeams(t *testing.T) {
|
||||
func TestIntegrationSQLStore_SearchTeams(t *testing.T) {
|
||||
type searchTeamsTestCase struct {
|
||||
desc string
|
||||
query *models.SearchTeamsQuery
|
||||
@@ -474,7 +474,7 @@ func TestSQLStore_SearchTeams(t *testing.T) {
|
||||
|
||||
// TestSQLStore_GetTeamMembers_ACFilter tests the accesscontrol filtering of
|
||||
// team members based on the signed in user permissions
|
||||
func TestSQLStore_GetTeamMembers_ACFilter(t *testing.T) {
|
||||
func TestIntegrationSQLStore_GetTeamMembers_ACFilter(t *testing.T) {
|
||||
testOrgID := int64(2)
|
||||
userIds := make([]int64, 4)
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestTempUserCommandsAndQueries(t *testing.T) {
|
||||
func TestIntegrationTempUserCommandsAndQueries(t *testing.T) {
|
||||
ss := InitTestDB(t)
|
||||
cmd := models.CreateTempUserCommand{
|
||||
OrgId: 2256,
|
||||
|
||||
@@ -15,7 +15,7 @@ import (
|
||||
|
||||
var ErrProvokedError = errors.New("testing error")
|
||||
|
||||
func TestTransaction(t *testing.T) {
|
||||
func TestIntegrationTransaction(t *testing.T) {
|
||||
ss := InitTestDB(t)
|
||||
|
||||
cmd := &models.AddApiKeyCommand{Key: "secret-key", Name: "key", OrgId: 1}
|
||||
@@ -56,7 +56,7 @@ func TestTransaction(t *testing.T) {
|
||||
})
|
||||
}
|
||||
|
||||
func TestReuseSessionWithTransaction(t *testing.T) {
|
||||
func TestIntegrationReuseSessionWithTransaction(t *testing.T) {
|
||||
ss := InitTestDB(t)
|
||||
|
||||
t.Run("top level transaction", func(t *testing.T) {
|
||||
|
||||
@@ -14,7 +14,7 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestUserDataAccess(t *testing.T) {
|
||||
func TestIntegrationUserDataAccess(t *testing.T) {
|
||||
|
||||
ss := InitTestDB(t)
|
||||
user := &models.SignedInUser{
|
||||
|
||||
Reference in New Issue
Block a user