Chore: Exclude integration tests from running on test-backend step (#50359)
* Chore: Exclude integration tests from running on test-backend step * Remove -v from go test command * Add check to skip integration tests before each integration test * Try to restart pipeline * Retrying to make pipeline run
This commit is contained in:
@@ -14,6 +14,9 @@ import (
|
||||
)
|
||||
|
||||
func TestIntegrationAlertNotificationSQLAccess(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test")
|
||||
}
|
||||
var sqlStore *SQLStore
|
||||
setup := func() { sqlStore = InitTestDB(t) }
|
||||
|
||||
|
||||
@@ -26,6 +26,9 @@ func resetTimeNow() {
|
||||
}
|
||||
|
||||
func TestIntegrationAlertingDataAccess(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test")
|
||||
}
|
||||
mockTimeNow()
|
||||
defer resetTimeNow()
|
||||
|
||||
@@ -260,6 +263,9 @@ func TestIntegrationAlertingDataAccess(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestIntegrationPausingAlerts(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test")
|
||||
}
|
||||
mockTimeNow()
|
||||
defer resetTimeNow()
|
||||
|
||||
|
||||
@@ -18,6 +18,9 @@ import (
|
||||
)
|
||||
|
||||
func TestIntegrationAnnotations(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test")
|
||||
}
|
||||
sql := sqlstore.InitTestDB(t)
|
||||
repo := sqlstore.NewSQLAnnotationRepo(sql)
|
||||
|
||||
@@ -380,6 +383,9 @@ func TestIntegrationAnnotations(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestIntegrationAnnotationListingWithRBAC(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test")
|
||||
}
|
||||
sql := sqlstore.InitTestDB(t, sqlstore.InitTestDBOpt{})
|
||||
repo := sqlstore.NewSQLAnnotationRepo(sql)
|
||||
dashboardStore := dashboardstore.ProvideDashboardStore(sql)
|
||||
|
||||
@@ -14,6 +14,9 @@ import (
|
||||
)
|
||||
|
||||
func TestIntegrationApiKeyDataAccess(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test")
|
||||
}
|
||||
mockTimeNow()
|
||||
defer resetTimeNow()
|
||||
|
||||
@@ -135,6 +138,9 @@ func TestIntegrationApiKeyDataAccess(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestIntegrationApiKeyErrors(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test")
|
||||
}
|
||||
mockTimeNow()
|
||||
defer resetTimeNow()
|
||||
|
||||
@@ -171,6 +177,9 @@ type getApiKeysTestCase struct {
|
||||
}
|
||||
|
||||
func TestIntegrationSQLStore_GetAPIKeys(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test")
|
||||
}
|
||||
tests := []getApiKeysTestCase{
|
||||
{
|
||||
desc: "expect all keys for wildcard scope",
|
||||
|
||||
@@ -15,6 +15,9 @@ import (
|
||||
)
|
||||
|
||||
func TestIntegrationDashboardSnapshotDBAccess(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test")
|
||||
}
|
||||
sqlstore := InitTestDB(t)
|
||||
|
||||
origSecret := setting.SecretKey
|
||||
@@ -142,6 +145,9 @@ func TestIntegrationDashboardSnapshotDBAccess(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestIntegrationDeleteExpiredSnapshots(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test")
|
||||
}
|
||||
sqlstore := InitTestDB(t)
|
||||
|
||||
t.Run("Testing dashboard snapshots clean up", func(t *testing.T) {
|
||||
|
||||
@@ -16,6 +16,9 @@ var theme = models.ThemeDark
|
||||
var kind = models.ThumbnailKindDefault
|
||||
|
||||
func TestIntegrationSqlStorage(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test")
|
||||
}
|
||||
var sqlStore *SQLStore
|
||||
var savedFolder *models.Dashboard
|
||||
|
||||
|
||||
@@ -17,6 +17,9 @@ import (
|
||||
)
|
||||
|
||||
func TestIntegrationDataAccess(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test")
|
||||
}
|
||||
defaultAddDatasourceCommand := models.AddDataSourceCommand{
|
||||
OrgId: 10,
|
||||
Name: "nisse",
|
||||
@@ -429,6 +432,9 @@ func TestIntegrationDataAccess(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestIntegrationGetDefaultDataSource(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test")
|
||||
}
|
||||
InitTestDB(t)
|
||||
|
||||
t.Run("should return error if there is no default datasource", func(t *testing.T) {
|
||||
|
||||
@@ -9,6 +9,9 @@ import (
|
||||
)
|
||||
|
||||
func TestIntegrationGetDBHealthQuery(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test")
|
||||
}
|
||||
store := InitTestDB(t)
|
||||
|
||||
query := models.GetDBHealthQuery{}
|
||||
|
||||
@@ -16,6 +16,9 @@ func mockTime(mock time.Time) time.Time {
|
||||
}
|
||||
|
||||
func TestIntegrationLoginAttempts(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test")
|
||||
}
|
||||
var beginningOfTime, timePlusOneMinute, timePlusTwoMinutes time.Time
|
||||
var sqlStore *SQLStore
|
||||
user := "user"
|
||||
|
||||
@@ -16,6 +16,9 @@ import (
|
||||
)
|
||||
|
||||
func TestIntegrationAccountDataAccess(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test")
|
||||
}
|
||||
t.Run("Testing Account DB Access", func(t *testing.T) {
|
||||
sqlStore := InitTestDB(t)
|
||||
testUser := &models.SignedInUser{
|
||||
|
||||
@@ -9,6 +9,9 @@ import (
|
||||
)
|
||||
|
||||
func TestIntegrationPlaylistDataAccess(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test")
|
||||
}
|
||||
ss := InitTestDB(t)
|
||||
|
||||
t.Run("Can create playlist", func(t *testing.T) {
|
||||
|
||||
@@ -11,6 +11,9 @@ import (
|
||||
)
|
||||
|
||||
func TestIntegrationPluginSettings(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test")
|
||||
}
|
||||
store := InitTestDB(t)
|
||||
|
||||
t.Run("Existing plugin settings", func(t *testing.T) {
|
||||
|
||||
@@ -11,6 +11,9 @@ import (
|
||||
)
|
||||
|
||||
func TestIntegrationQuotaCommandsAndQueries(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test")
|
||||
}
|
||||
sqlStore := InitTestDB(t)
|
||||
userId := int64(1)
|
||||
orgId := int64(0)
|
||||
|
||||
@@ -14,6 +14,9 @@ import (
|
||||
)
|
||||
|
||||
func TestIntegrationSQLBuilder(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test")
|
||||
}
|
||||
t.Run("WriteDashboardPermissionFilter", func(t *testing.T) {
|
||||
t.Run("user ACL", func(t *testing.T) {
|
||||
test(t,
|
||||
|
||||
@@ -75,6 +75,9 @@ var sqlStoreTestCases = []sqlStoreTest{
|
||||
}
|
||||
|
||||
func TestIntegrationSQLConnectionString(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test")
|
||||
}
|
||||
for _, testCase := range sqlStoreTestCases {
|
||||
t.Run(testCase.name, func(t *testing.T) {
|
||||
sqlstore := &SQLStore{}
|
||||
|
||||
@@ -9,6 +9,9 @@ import (
|
||||
)
|
||||
|
||||
func TestIntegration_GetAdminStats(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test")
|
||||
}
|
||||
sqlStore := InitTestDB(t)
|
||||
|
||||
query := models.GetAdminStatsQuery{}
|
||||
|
||||
@@ -11,6 +11,9 @@ import (
|
||||
)
|
||||
|
||||
func TestIntegrationStatsDataAccess(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test")
|
||||
}
|
||||
sqlStore := InitTestDB(t)
|
||||
populateDB(t, sqlStore)
|
||||
|
||||
|
||||
@@ -10,6 +10,9 @@ import (
|
||||
)
|
||||
|
||||
func TestIntegrationSavingTags(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test")
|
||||
}
|
||||
ss := InitTestDB(t)
|
||||
|
||||
tagPairs := []*models.Tag{
|
||||
|
||||
@@ -14,6 +14,9 @@ import (
|
||||
)
|
||||
|
||||
func TestIntegrationTeamCommandsAndQueries(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test")
|
||||
}
|
||||
t.Run("Testing Team commands & queries", func(t *testing.T) {
|
||||
sqlStore := InitTestDB(t)
|
||||
testUser := &models.SignedInUser{
|
||||
@@ -405,6 +408,9 @@ func TestIntegrationTeamCommandsAndQueries(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestIntegrationSQLStore_SearchTeams(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test")
|
||||
}
|
||||
type searchTeamsTestCase struct {
|
||||
desc string
|
||||
query *models.SearchTeamsQuery
|
||||
@@ -478,6 +484,9 @@ func TestIntegrationSQLStore_SearchTeams(t *testing.T) {
|
||||
// TestSQLStore_GetTeamMembers_ACFilter tests the accesscontrol filtering of
|
||||
// team members based on the signed in user permissions
|
||||
func TestIntegrationSQLStore_GetTeamMembers_ACFilter(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test")
|
||||
}
|
||||
testOrgID := int64(2)
|
||||
userIds := make([]int64, 4)
|
||||
|
||||
|
||||
@@ -11,6 +11,9 @@ import (
|
||||
)
|
||||
|
||||
func TestIntegrationTempUserCommandsAndQueries(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test")
|
||||
}
|
||||
ss := InitTestDB(t)
|
||||
cmd := models.CreateTempUserCommand{
|
||||
OrgId: 2256,
|
||||
|
||||
@@ -13,6 +13,9 @@ import (
|
||||
var ErrProvokedError = errors.New("testing error")
|
||||
|
||||
func TestIntegrationTransaction(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test")
|
||||
}
|
||||
ss := InitTestDB(t)
|
||||
|
||||
cmd := &models.AddApiKeyCommand{Key: "secret-key", Name: "key", OrgId: 1}
|
||||
@@ -54,6 +57,9 @@ func TestIntegrationTransaction(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestIntegrationReuseSessionWithTransaction(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test")
|
||||
}
|
||||
ss := InitTestDB(t)
|
||||
|
||||
t.Run("top level transaction", func(t *testing.T) {
|
||||
|
||||
@@ -11,6 +11,9 @@ import (
|
||||
)
|
||||
|
||||
func TestIntegrationUserDataAccess(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test")
|
||||
}
|
||||
ss := InitTestDB(t)
|
||||
user := &models.SignedInUser{
|
||||
OrgId: 1,
|
||||
|
||||
Reference in New Issue
Block a user