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:
Kat Yang 2022-06-10 11:46:21 -04:00 committed by GitHub
parent 336c9fd513
commit bd35e6917a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
54 changed files with 240 additions and 15 deletions

View File

@ -141,7 +141,7 @@ steps:
image: grafana/build-container:1.5.5 image: grafana/build-container:1.5.5
name: lint-backend name: lint-backend
- commands: - commands:
- ./bin/grabpl test-backend --edition oss - go test -short -covermode=atomic -timeout=30m ./pkg/...
depends_on: depends_on:
- wire-install - wire-install
image: grafana/build-container:1.5.5 image: grafana/build-container:1.5.5
@ -812,7 +812,7 @@ steps:
image: grafana/build-container:1.5.5 image: grafana/build-container:1.5.5
name: lint-backend name: lint-backend
- commands: - commands:
- ./bin/grabpl test-backend --edition oss - go test -short -covermode=atomic -timeout=30m ./pkg/...
depends_on: depends_on:
- wire-install - wire-install
image: grafana/build-container:1.5.5 image: grafana/build-container:1.5.5
@ -1884,7 +1884,7 @@ steps:
image: grafana/build-container:1.5.5 image: grafana/build-container:1.5.5
name: lint-frontend name: lint-frontend
- commands: - commands:
- ./bin/grabpl test-backend --edition oss - go test -short -covermode=atomic -timeout=30m ./pkg/...
depends_on: depends_on:
- wire-install - wire-install
image: grafana/build-container:1.5.5 image: grafana/build-container:1.5.5
@ -3666,7 +3666,7 @@ steps:
image: grafana/build-container:1.5.5 image: grafana/build-container:1.5.5
name: lint-frontend name: lint-frontend
- commands: - commands:
- ./bin/grabpl test-backend --edition oss - go test -short -covermode=atomic -timeout=30m ./pkg/...
depends_on: depends_on:
- wire-install - wire-install
image: grafana/build-container:1.5.5 image: grafana/build-container:1.5.5
@ -4683,6 +4683,6 @@ kind: secret
name: gcp_upload_artifacts_key name: gcp_upload_artifacts_key
--- ---
kind: signature kind: signature
hmac: 0abf901971b403a4cf5887d1051ec4a656335a23d9a92809a71312d115b4862f hmac: df6f9fbc1fe40e3ecad762194eeb466ded8aa92cc0ee13a77ea5142d9a3a4749
... ...

View File

@ -170,6 +170,9 @@ func runTests(createCases func() []fsTestCase, t *testing.T) {
} }
func TestIntegrationFsStorage(t *testing.T) { func TestIntegrationFsStorage(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
//skipTest := true //skipTest := true
emptyContents := make([]byte, 0) emptyContents := make([]byte, 0)
pngImage, _ := base64.StdEncoding.DecodeString(pngImageBase64) pngImage, _ := base64.StdEncoding.DecodeString(pngImageBase64)

View File

@ -37,6 +37,9 @@ func (t *TestCase) Value() string {
} }
func TestIntegrationKVStore(t *testing.T) { func TestIntegrationKVStore(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
kv := createTestableKVStore(t) kv := createTestableKVStore(t)
ctx := context.Background() ctx := context.Background()

View File

@ -9,6 +9,9 @@ import (
) )
func TestIntegrationServerLok(t *testing.T) { func TestIntegrationServerLok(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
sl := createTestableServerLock(t) sl := createTestableServerLock(t)
counter := 0 counter := 0

View File

@ -18,6 +18,9 @@ import (
) )
func TestIntegrationEngineTimeouts(t *testing.T) { func TestIntegrationEngineTimeouts(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
usMock := &usagestats.UsageStatsMock{T: t} usMock := &usagestats.UsageStatsMock{T: t}
tracer, err := tracing.InitializeTracerForTest() tracer, err := tracing.InitializeTracerForTest()
require.NoError(t, err) require.NoError(t, err)

View File

@ -10,6 +10,9 @@ import (
) )
func TestIntegrationDashboardAclDataAccess(t *testing.T) { func TestIntegrationDashboardAclDataAccess(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
var sqlStore *sqlstore.SQLStore var sqlStore *sqlstore.SQLStore
var currentUser models.User var currentUser models.User
var savedFolder, childDash *models.Dashboard var savedFolder, childDash *models.Dashboard

View File

@ -12,6 +12,9 @@ import (
) )
func TestIntegrationDashboardFolderDataAccess(t *testing.T) { func TestIntegrationDashboardFolderDataAccess(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
t.Run("Testing DB", func(t *testing.T) { t.Run("Testing DB", func(t *testing.T) {
var sqlStore *sqlstore.SQLStore var sqlStore *sqlstore.SQLStore
var folder, dashInRoot, childDash *models.Dashboard var folder, dashInRoot, childDash *models.Dashboard

View File

@ -14,6 +14,9 @@ import (
) )
func TestIntegrationDashboardProvisioningTest(t *testing.T) { func TestIntegrationDashboardProvisioningTest(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
sqlStore := sqlstore.InitTestDB(t) sqlStore := sqlstore.InitTestDB(t)
dashboardStore := ProvideDashboardStore(sqlStore) dashboardStore := ProvideDashboardStore(sqlStore)

View File

@ -21,6 +21,9 @@ import (
) )
func TestIntegrationDashboardDataAccess(t *testing.T) { func TestIntegrationDashboardDataAccess(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
var sqlStore *sqlstore.SQLStore var sqlStore *sqlstore.SQLStore
var savedFolder, savedDash, savedDash2 *models.Dashboard var savedFolder, savedDash, savedDash2 *models.Dashboard
var dashboardStore *DashboardStore var dashboardStore *DashboardStore
@ -476,6 +479,9 @@ func TestIntegrationDashboardDataAccess(t *testing.T) {
} }
func TestIntegrationDashboardDataAccessGivenPluginWithImportedDashboards(t *testing.T) { func TestIntegrationDashboardDataAccessGivenPluginWithImportedDashboards(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
sqlStore := sqlstore.InitTestDB(t) sqlStore := sqlstore.InitTestDB(t)
dashboardStore := ProvideDashboardStore(sqlStore) dashboardStore := ProvideDashboardStore(sqlStore)
pluginId := "test-app" pluginId := "test-app"
@ -495,6 +501,9 @@ func TestIntegrationDashboardDataAccessGivenPluginWithImportedDashboards(t *test
} }
func TestIntegrationDashboard_SortingOptions(t *testing.T) { func TestIntegrationDashboard_SortingOptions(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
sqlStore := sqlstore.InitTestDB(t) sqlStore := sqlstore.InitTestDB(t)
dashboardStore := ProvideDashboardStore(sqlStore) dashboardStore := ProvideDashboardStore(sqlStore)
@ -541,6 +550,9 @@ func TestIntegrationDashboard_SortingOptions(t *testing.T) {
} }
func TestIntegrationDashboard_Filter(t *testing.T) { func TestIntegrationDashboard_Filter(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
sqlStore := sqlstore.InitTestDB(t) sqlStore := sqlstore.InitTestDB(t)
dashboardStore := ProvideDashboardStore(sqlStore) dashboardStore := ProvideDashboardStore(sqlStore)
insertTestDashboard(t, dashboardStore, "Alfa", 1, 0, false) insertTestDashboard(t, dashboardStore, "Alfa", 1, 0, false)

View File

@ -22,6 +22,9 @@ import (
const testOrgID int64 = 1 const testOrgID int64 = 1
func TestIntegrationIntegratedDashboardService(t *testing.T) { func TestIntegrationIntegratedDashboardService(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
t.Run("Given saved folders and dashboards in organization A", func(t *testing.T) { t.Run("Given saved folders and dashboards in organization A", func(t *testing.T) {
// Basic validation tests // Basic validation tests

View File

@ -17,6 +17,9 @@ import (
) )
func TestIntegrationDashboardService(t *testing.T) { func TestIntegrationDashboardService(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
t.Run("Dashboard service tests", func(t *testing.T) { t.Run("Dashboard service tests", func(t *testing.T) {
fakeStore := m.FakeDashboardStore{} fakeStore := m.FakeDashboardStore{}
defer fakeStore.AssertExpectations(t) defer fakeStore.AssertExpectations(t)

View File

@ -23,6 +23,9 @@ var orgID = int64(1)
var user = &models.SignedInUser{UserId: 1} var user = &models.SignedInUser{UserId: 1}
func TestIntegrationProvideFolderService(t *testing.T) { func TestIntegrationProvideFolderService(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
t.Run("should register scope resolvers", func(t *testing.T) { t.Run("should register scope resolvers", func(t *testing.T) {
cfg := setting.NewCfg() cfg := setting.NewCfg()
ac := acmock.New() ac := acmock.New()
@ -34,6 +37,9 @@ func TestIntegrationProvideFolderService(t *testing.T) {
} }
func TestIntegrationFolderService(t *testing.T) { func TestIntegrationFolderService(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
t.Run("Folder service tests", func(t *testing.T) { t.Run("Folder service tests", func(t *testing.T) {
store := &dashboards.FakeDashboardStore{} store := &dashboards.FakeDashboardStore{}
cfg := setting.NewCfg() cfg := setting.NewCfg()

View File

@ -16,6 +16,9 @@ import (
) )
func TestIntegrationGetDashboardVersion(t *testing.T) { func TestIntegrationGetDashboardVersion(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
ss := sqlstore.InitTestDB(t) ss := sqlstore.InitTestDB(t)
dashVerStore := sqlStore{db: ss} dashVerStore := sqlStore{db: ss}
@ -59,6 +62,9 @@ func TestIntegrationGetDashboardVersion(t *testing.T) {
} }
func TestIntegrationDeleteExpiredVersions(t *testing.T) { func TestIntegrationDeleteExpiredVersions(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
versionsToWrite := 10 versionsToWrite := 10
ss := sqlstore.InitTestDB(t) ss := sqlstore.InitTestDB(t)
dashVerStore := sqlStore{db: ss} dashVerStore := sqlStore{db: ss}
@ -80,6 +86,9 @@ func TestIntegrationDeleteExpiredVersions(t *testing.T) {
} }
func TestIntegrationListDashboardVersions(t *testing.T) { func TestIntegrationListDashboardVersions(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
ss := sqlstore.InitTestDB(t) ss := sqlstore.InitTestDB(t)
dashVerStore := sqlStore{db: ss, dialect: ss.Dialect} dashVerStore := sqlStore{db: ss, dialect: ss.Dialect}
savedDash := insertTestDashboard(t, ss, "test dash 43", 1, 0, false, "diff-all") savedDash := insertTestDashboard(t, ss, "test dash 43", 1, 0, false, "diff-all")

View File

@ -10,6 +10,9 @@ import (
) )
func TestIntegrationLiveMessage(t *testing.T) { func TestIntegrationLiveMessage(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
storage := SetupTestStorage(t) storage := SetupTestStorage(t)
getQuery := &models.GetLiveMessageQuery{ getQuery := &models.GetLiveMessageQuery{

View File

@ -12,6 +12,9 @@ import (
) )
func TestIntegrationAlertManagerHash(t *testing.T) { func TestIntegrationAlertManagerHash(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
sqlStore := sqlstore.InitTestDB(t) sqlStore := sqlstore.InitTestDB(t)
store := &DBstore{ store := &DBstore{
SQLStore: sqlStore, SQLStore: sqlStore,

View File

@ -38,6 +38,9 @@ func addToken(img *models.Image) *models.Image {
} }
func TestIntegrationSaveAndGetImage(t *testing.T) { func TestIntegrationSaveAndGetImage(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
mockTimeNow() mockTimeNow()
ctx := context.Background() ctx := context.Background()
_, dbstore := tests.SetupTestEnv(t, baseIntervalSeconds) _, dbstore := tests.SetupTestEnv(t, baseIntervalSeconds)
@ -91,6 +94,9 @@ func TestIntegrationSaveAndGetImage(t *testing.T) {
} }
func TestIntegrationGetImages(t *testing.T) { func TestIntegrationGetImages(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
mockTimeNow() mockTimeNow()
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel() defer cancel()
@ -141,6 +147,9 @@ func TestIntegrationGetImages(t *testing.T) {
} }
func TestIntegrationDeleteExpiredImages(t *testing.T) { func TestIntegrationDeleteExpiredImages(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
mockTimeNow() mockTimeNow()
ctx, cancel := context.WithTimeout(context.Background(), 1*time.Minute) ctx, cancel := context.WithTimeout(context.Background(), 1*time.Minute)
defer cancel() defer cancel()

View File

@ -25,6 +25,9 @@ func mockTimeNow() {
} }
func TestIntegrationAlertInstanceOperations(t *testing.T) { func TestIntegrationAlertInstanceOperations(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
ctx := context.Background() ctx := context.Background()
_, dbstore := tests.SetupTestEnv(t, baseIntervalSeconds) _, dbstore := tests.SetupTestEnv(t, baseIntervalSeconds)

View File

@ -13,6 +13,9 @@ import (
) )
func TestIntegrationPreferencesDataAccess(t *testing.T) { func TestIntegrationPreferencesDataAccess(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
ss := sqlstore.InitTestDB(t) ss := sqlstore.InitTestDB(t)
prefStore := sqlStore{db: ss} prefStore := sqlStore{db: ss}
orgNavbarPreferences := pref.NavbarPreference{ orgNavbarPreferences := pref.NavbarPreference{

View File

@ -8,6 +8,9 @@ import (
) )
func TestIntegrationCreateQueryInQueryHistory(t *testing.T) { func TestIntegrationCreateQueryInQueryHistory(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
testScenario(t, "When users tries to create query in query history it should succeed", testScenario(t, "When users tries to create query in query history it should succeed",
func(t *testing.T, sc scenarioContext) { func(t *testing.T, sc scenarioContext) {
command := CreateQueryInQueryHistoryCommand{ command := CreateQueryInQueryHistoryCommand{

View File

@ -10,6 +10,9 @@ import (
) )
func TestIntegrationDeleteStaleQueryFromQueryHistory(t *testing.T) { func TestIntegrationDeleteStaleQueryFromQueryHistory(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
testScenarioWithQueryInQueryHistory(t, "Stale query history can be deleted", testScenarioWithQueryInQueryHistory(t, "Stale query history can be deleted",
func(t *testing.T, sc scenarioContext) { func(t *testing.T, sc scenarioContext) {
olderThan := time.Now().Unix() + 60 olderThan := time.Now().Unix() + 60

View File

@ -10,6 +10,9 @@ import (
) )
func TestIntegrationDeleteQueryFromQueryHistory(t *testing.T) { func TestIntegrationDeleteQueryFromQueryHistory(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
testScenarioWithQueryInQueryHistory(t, "When users tries to delete query in query history that does not exist, it should fail", testScenarioWithQueryInQueryHistory(t, "When users tries to delete query in query history that does not exist, it should fail",
func(t *testing.T, sc scenarioContext) { func(t *testing.T, sc scenarioContext) {
resp := sc.service.deleteHandler(sc.reqContext) resp := sc.service.deleteHandler(sc.reqContext)

View File

@ -8,6 +8,9 @@ import (
) )
func TestIntegrationEnforceRowLimitInQueryHistory(t *testing.T) { func TestIntegrationEnforceRowLimitInQueryHistory(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
testScenarioWithQueryInQueryHistory(t, "Enforce limit for query_history", testScenarioWithQueryInQueryHistory(t, "Enforce limit for query_history",
func(t *testing.T, sc scenarioContext) { func(t *testing.T, sc scenarioContext) {
limit := 0 limit := 0

View File

@ -10,6 +10,9 @@ import (
) )
func TestIntegrationMigrateQueriesToQueryHistory(t *testing.T) { func TestIntegrationMigrateQueriesToQueryHistory(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
testScenario(t, "When users tries to migrate 1 query in query history it should succeed", testScenario(t, "When users tries to migrate 1 query in query history it should succeed",
func(t *testing.T, sc scenarioContext) { func(t *testing.T, sc scenarioContext) {
command := MigrateQueriesToQueryHistoryCommand{ command := MigrateQueriesToQueryHistoryCommand{

View File

@ -8,6 +8,9 @@ import (
) )
func TestIntegrationPatchQueryCommentInQueryHistory(t *testing.T) { func TestIntegrationPatchQueryCommentInQueryHistory(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
testScenarioWithQueryInQueryHistory(t, "When user tries to patch comment of query in query history that does not exist, it should fail", testScenarioWithQueryInQueryHistory(t, "When user tries to patch comment of query in query history that does not exist, it should fail",
func(t *testing.T, sc scenarioContext) { func(t *testing.T, sc scenarioContext) {
resp := sc.service.patchCommentHandler(sc.reqContext) resp := sc.service.patchCommentHandler(sc.reqContext)

View File

@ -10,6 +10,9 @@ import (
) )
func TestIntegrationGetQueriesFromQueryHistory(t *testing.T) { func TestIntegrationGetQueriesFromQueryHistory(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
testScenario(t, "When users tries to get query in empty query history, it should return empty result", testScenario(t, "When users tries to get query in empty query history, it should return empty result",
func(t *testing.T, sc scenarioContext) { func(t *testing.T, sc scenarioContext) {
sc.reqContext.Req.Form.Add("datasourceUid", "test") sc.reqContext.Req.Form.Add("datasourceUid", "test")

View File

@ -8,6 +8,9 @@ import (
) )
func TestIntegrationStarQueryInQueryHistory(t *testing.T) { func TestIntegrationStarQueryInQueryHistory(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
testScenarioWithQueryInQueryHistory(t, "When users tries to star query in query history that does not exists, it should fail", testScenarioWithQueryInQueryHistory(t, "When users tries to star query in query history that does not exists, it should fail",
func(t *testing.T, sc scenarioContext) { func(t *testing.T, sc scenarioContext) {
resp := sc.service.starHandler(sc.reqContext) resp := sc.service.starHandler(sc.reqContext)

View File

@ -8,6 +8,9 @@ import (
) )
func TestIntegrationUnstarQueryInQueryHistory(t *testing.T) { func TestIntegrationUnstarQueryInQueryHistory(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
testScenarioWithQueryInQueryHistory(t, "When users tries to unstar query in query history that does not exists, it should fail", testScenarioWithQueryInQueryHistory(t, "When users tries to unstar query in query history that does not exists, it should fail",
func(t *testing.T, sc scenarioContext) { func(t *testing.T, sc scenarioContext) {
resp := sc.service.starHandler(sc.reqContext) resp := sc.service.starHandler(sc.reqContext)

View File

@ -14,6 +14,9 @@ import (
) )
func TestIntegrationAlertNotificationSQLAccess(t *testing.T) { func TestIntegrationAlertNotificationSQLAccess(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
var sqlStore *SQLStore var sqlStore *SQLStore
setup := func() { sqlStore = InitTestDB(t) } setup := func() { sqlStore = InitTestDB(t) }

View File

@ -26,6 +26,9 @@ func resetTimeNow() {
} }
func TestIntegrationAlertingDataAccess(t *testing.T) { func TestIntegrationAlertingDataAccess(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
mockTimeNow() mockTimeNow()
defer resetTimeNow() defer resetTimeNow()
@ -260,6 +263,9 @@ func TestIntegrationAlertingDataAccess(t *testing.T) {
} }
func TestIntegrationPausingAlerts(t *testing.T) { func TestIntegrationPausingAlerts(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
mockTimeNow() mockTimeNow()
defer resetTimeNow() defer resetTimeNow()

View File

@ -18,6 +18,9 @@ import (
) )
func TestIntegrationAnnotations(t *testing.T) { func TestIntegrationAnnotations(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
sql := sqlstore.InitTestDB(t) sql := sqlstore.InitTestDB(t)
repo := sqlstore.NewSQLAnnotationRepo(sql) repo := sqlstore.NewSQLAnnotationRepo(sql)
@ -380,6 +383,9 @@ func TestIntegrationAnnotations(t *testing.T) {
} }
func TestIntegrationAnnotationListingWithRBAC(t *testing.T) { func TestIntegrationAnnotationListingWithRBAC(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
sql := sqlstore.InitTestDB(t, sqlstore.InitTestDBOpt{}) sql := sqlstore.InitTestDB(t, sqlstore.InitTestDBOpt{})
repo := sqlstore.NewSQLAnnotationRepo(sql) repo := sqlstore.NewSQLAnnotationRepo(sql)
dashboardStore := dashboardstore.ProvideDashboardStore(sql) dashboardStore := dashboardstore.ProvideDashboardStore(sql)

View File

@ -14,6 +14,9 @@ import (
) )
func TestIntegrationApiKeyDataAccess(t *testing.T) { func TestIntegrationApiKeyDataAccess(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
mockTimeNow() mockTimeNow()
defer resetTimeNow() defer resetTimeNow()
@ -135,6 +138,9 @@ func TestIntegrationApiKeyDataAccess(t *testing.T) {
} }
func TestIntegrationApiKeyErrors(t *testing.T) { func TestIntegrationApiKeyErrors(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
mockTimeNow() mockTimeNow()
defer resetTimeNow() defer resetTimeNow()
@ -171,6 +177,9 @@ type getApiKeysTestCase struct {
} }
func TestIntegrationSQLStore_GetAPIKeys(t *testing.T) { func TestIntegrationSQLStore_GetAPIKeys(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
tests := []getApiKeysTestCase{ tests := []getApiKeysTestCase{
{ {
desc: "expect all keys for wildcard scope", desc: "expect all keys for wildcard scope",

View File

@ -15,6 +15,9 @@ import (
) )
func TestIntegrationDashboardSnapshotDBAccess(t *testing.T) { func TestIntegrationDashboardSnapshotDBAccess(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
sqlstore := InitTestDB(t) sqlstore := InitTestDB(t)
origSecret := setting.SecretKey origSecret := setting.SecretKey
@ -142,6 +145,9 @@ func TestIntegrationDashboardSnapshotDBAccess(t *testing.T) {
} }
func TestIntegrationDeleteExpiredSnapshots(t *testing.T) { func TestIntegrationDeleteExpiredSnapshots(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
sqlstore := InitTestDB(t) sqlstore := InitTestDB(t)
t.Run("Testing dashboard snapshots clean up", func(t *testing.T) { t.Run("Testing dashboard snapshots clean up", func(t *testing.T) {

View File

@ -16,6 +16,9 @@ var theme = models.ThemeDark
var kind = models.ThumbnailKindDefault var kind = models.ThumbnailKindDefault
func TestIntegrationSqlStorage(t *testing.T) { func TestIntegrationSqlStorage(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
var sqlStore *SQLStore var sqlStore *SQLStore
var savedFolder *models.Dashboard var savedFolder *models.Dashboard

View File

@ -17,6 +17,9 @@ import (
) )
func TestIntegrationDataAccess(t *testing.T) { func TestIntegrationDataAccess(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
defaultAddDatasourceCommand := models.AddDataSourceCommand{ defaultAddDatasourceCommand := models.AddDataSourceCommand{
OrgId: 10, OrgId: 10,
Name: "nisse", Name: "nisse",
@ -429,6 +432,9 @@ func TestIntegrationDataAccess(t *testing.T) {
} }
func TestIntegrationGetDefaultDataSource(t *testing.T) { func TestIntegrationGetDefaultDataSource(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
InitTestDB(t) InitTestDB(t)
t.Run("should return error if there is no default datasource", func(t *testing.T) { t.Run("should return error if there is no default datasource", func(t *testing.T) {

View File

@ -9,6 +9,9 @@ import (
) )
func TestIntegrationGetDBHealthQuery(t *testing.T) { func TestIntegrationGetDBHealthQuery(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
store := InitTestDB(t) store := InitTestDB(t)
query := models.GetDBHealthQuery{} query := models.GetDBHealthQuery{}

View File

@ -16,6 +16,9 @@ func mockTime(mock time.Time) time.Time {
} }
func TestIntegrationLoginAttempts(t *testing.T) { func TestIntegrationLoginAttempts(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
var beginningOfTime, timePlusOneMinute, timePlusTwoMinutes time.Time var beginningOfTime, timePlusOneMinute, timePlusTwoMinutes time.Time
var sqlStore *SQLStore var sqlStore *SQLStore
user := "user" user := "user"

View File

@ -16,6 +16,9 @@ import (
) )
func TestIntegrationAccountDataAccess(t *testing.T) { func TestIntegrationAccountDataAccess(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
t.Run("Testing Account DB Access", func(t *testing.T) { t.Run("Testing Account DB Access", func(t *testing.T) {
sqlStore := InitTestDB(t) sqlStore := InitTestDB(t)
testUser := &models.SignedInUser{ testUser := &models.SignedInUser{

View File

@ -9,6 +9,9 @@ import (
) )
func TestIntegrationPlaylistDataAccess(t *testing.T) { func TestIntegrationPlaylistDataAccess(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
ss := InitTestDB(t) ss := InitTestDB(t)
t.Run("Can create playlist", func(t *testing.T) { t.Run("Can create playlist", func(t *testing.T) {

View File

@ -11,6 +11,9 @@ import (
) )
func TestIntegrationPluginSettings(t *testing.T) { func TestIntegrationPluginSettings(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
store := InitTestDB(t) store := InitTestDB(t)
t.Run("Existing plugin settings", func(t *testing.T) { t.Run("Existing plugin settings", func(t *testing.T) {

View File

@ -11,6 +11,9 @@ import (
) )
func TestIntegrationQuotaCommandsAndQueries(t *testing.T) { func TestIntegrationQuotaCommandsAndQueries(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
sqlStore := InitTestDB(t) sqlStore := InitTestDB(t)
userId := int64(1) userId := int64(1)
orgId := int64(0) orgId := int64(0)

View File

@ -14,6 +14,9 @@ import (
) )
func TestIntegrationSQLBuilder(t *testing.T) { func TestIntegrationSQLBuilder(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
t.Run("WriteDashboardPermissionFilter", func(t *testing.T) { t.Run("WriteDashboardPermissionFilter", func(t *testing.T) {
t.Run("user ACL", func(t *testing.T) { t.Run("user ACL", func(t *testing.T) {
test(t, test(t,

View File

@ -75,6 +75,9 @@ var sqlStoreTestCases = []sqlStoreTest{
} }
func TestIntegrationSQLConnectionString(t *testing.T) { func TestIntegrationSQLConnectionString(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
for _, testCase := range sqlStoreTestCases { for _, testCase := range sqlStoreTestCases {
t.Run(testCase.name, func(t *testing.T) { t.Run(testCase.name, func(t *testing.T) {
sqlstore := &SQLStore{} sqlstore := &SQLStore{}

View File

@ -9,6 +9,9 @@ import (
) )
func TestIntegration_GetAdminStats(t *testing.T) { func TestIntegration_GetAdminStats(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
sqlStore := InitTestDB(t) sqlStore := InitTestDB(t)
query := models.GetAdminStatsQuery{} query := models.GetAdminStatsQuery{}

View File

@ -11,6 +11,9 @@ import (
) )
func TestIntegrationStatsDataAccess(t *testing.T) { func TestIntegrationStatsDataAccess(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
sqlStore := InitTestDB(t) sqlStore := InitTestDB(t)
populateDB(t, sqlStore) populateDB(t, sqlStore)

View File

@ -10,6 +10,9 @@ import (
) )
func TestIntegrationSavingTags(t *testing.T) { func TestIntegrationSavingTags(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
ss := InitTestDB(t) ss := InitTestDB(t)
tagPairs := []*models.Tag{ tagPairs := []*models.Tag{

View File

@ -14,6 +14,9 @@ import (
) )
func TestIntegrationTeamCommandsAndQueries(t *testing.T) { func TestIntegrationTeamCommandsAndQueries(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
t.Run("Testing Team commands & queries", func(t *testing.T) { t.Run("Testing Team commands & queries", func(t *testing.T) {
sqlStore := InitTestDB(t) sqlStore := InitTestDB(t)
testUser := &models.SignedInUser{ testUser := &models.SignedInUser{
@ -405,6 +408,9 @@ func TestIntegrationTeamCommandsAndQueries(t *testing.T) {
} }
func TestIntegrationSQLStore_SearchTeams(t *testing.T) { func TestIntegrationSQLStore_SearchTeams(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
type searchTeamsTestCase struct { type searchTeamsTestCase struct {
desc string desc string
query *models.SearchTeamsQuery query *models.SearchTeamsQuery
@ -478,6 +484,9 @@ func TestIntegrationSQLStore_SearchTeams(t *testing.T) {
// TestSQLStore_GetTeamMembers_ACFilter tests the accesscontrol filtering of // TestSQLStore_GetTeamMembers_ACFilter tests the accesscontrol filtering of
// team members based on the signed in user permissions // team members based on the signed in user permissions
func TestIntegrationSQLStore_GetTeamMembers_ACFilter(t *testing.T) { func TestIntegrationSQLStore_GetTeamMembers_ACFilter(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
testOrgID := int64(2) testOrgID := int64(2)
userIds := make([]int64, 4) userIds := make([]int64, 4)

View File

@ -11,6 +11,9 @@ import (
) )
func TestIntegrationTempUserCommandsAndQueries(t *testing.T) { func TestIntegrationTempUserCommandsAndQueries(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
ss := InitTestDB(t) ss := InitTestDB(t)
cmd := models.CreateTempUserCommand{ cmd := models.CreateTempUserCommand{
OrgId: 2256, OrgId: 2256,

View File

@ -13,6 +13,9 @@ import (
var ErrProvokedError = errors.New("testing error") var ErrProvokedError = errors.New("testing error")
func TestIntegrationTransaction(t *testing.T) { func TestIntegrationTransaction(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
ss := InitTestDB(t) ss := InitTestDB(t)
cmd := &models.AddApiKeyCommand{Key: "secret-key", Name: "key", OrgId: 1} cmd := &models.AddApiKeyCommand{Key: "secret-key", Name: "key", OrgId: 1}
@ -54,6 +57,9 @@ func TestIntegrationTransaction(t *testing.T) {
} }
func TestIntegrationReuseSessionWithTransaction(t *testing.T) { func TestIntegrationReuseSessionWithTransaction(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
ss := InitTestDB(t) ss := InitTestDB(t)
t.Run("top level transaction", func(t *testing.T) { t.Run("top level transaction", func(t *testing.T) {

View File

@ -11,6 +11,9 @@ import (
) )
func TestIntegrationUserDataAccess(t *testing.T) { func TestIntegrationUserDataAccess(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
ss := InitTestDB(t) ss := InitTestDB(t)
user := &models.SignedInUser{ user := &models.SignedInUser{
OrgId: 1, OrgId: 1,

View File

@ -10,6 +10,9 @@ import (
) )
func TestIntegrationUserStarsDataAccess(t *testing.T) { func TestIntegrationUserStarsDataAccess(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
t.Run("Testing User Stars Data Access", func(t *testing.T) { t.Run("Testing User Stars Data Access", func(t *testing.T) {
ss := sqlstore.InitTestDB(t) ss := sqlstore.InitTestDB(t)
starStore := sqlStore{db: ss} starStore := sqlStore{db: ss}

View File

@ -11,6 +11,9 @@ import (
) )
func TestIntegrationEntityEventsService(t *testing.T) { func TestIntegrationEntityEventsService(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
var ctx context.Context var ctx context.Context
var service EntityEventsService var service EntityEventsService
@ -135,6 +138,9 @@ func TestIntegrationEntityEventsService(t *testing.T) {
} }
func TestIntegrationCreateDatabaseEntityId(t *testing.T) { func TestIntegrationCreateDatabaseEntityId(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
tests := []struct { tests := []struct {
name string name string
entityType EntityType entityType EntityType

View File

@ -26,6 +26,9 @@ import (
// use to verify that the generated data are visualized as expected, see // use to verify that the generated data are visualized as expected, see
// devenv/README.md for setup instructions. // devenv/README.md for setup instructions.
func TestIntegrationMySQL(t *testing.T) { func TestIntegrationMySQL(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
// change to true to run the MySQL tests // change to true to run the MySQL tests
runMySQLTests := false runMySQLTests := false
// runMySqlTests := true // runMySqlTests := true

View File

@ -23,6 +23,9 @@ import (
// Test generateConnectionString. // Test generateConnectionString.
func TestIntegrationGenerateConnectionString(t *testing.T) { func TestIntegrationGenerateConnectionString(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
cfg := setting.NewCfg() cfg := setting.NewCfg()
cfg.DataPath = t.TempDir() cfg.DataPath = t.TempDir()
@ -170,6 +173,9 @@ func TestIntegrationGenerateConnectionString(t *testing.T) {
// use to verify that the generated data are visualized as expected, see // use to verify that the generated data are visualized as expected, see
// devenv/README.md for setup instructions. // devenv/README.md for setup instructions.
func TestIntegrationPostgres(t *testing.T) { func TestIntegrationPostgres(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
// change to true to run the PostgreSQL tests // change to true to run the PostgreSQL tests
const runPostgresTests = false const runPostgresTests = false

View File

@ -502,16 +502,28 @@ def build_plugins_step(edition, sign=False):
def test_backend_step(edition): def test_backend_step(edition):
return { if edition == 'oss':
'name': 'test-backend' + enterprise2_suffix(edition), return {
'image': build_image, 'name': 'test-backend' + enterprise2_suffix(edition),
'depends_on': [ 'image': build_image,
'wire-install', 'depends_on': [
], 'wire-install',
'commands': [ ],
'./bin/grabpl test-backend --edition {}'.format(edition), 'commands': [
], 'go test -short -covermode=atomic -timeout=30m ./pkg/...',
} ],
}
else:
return {
'name': 'test-backend' + enterprise2_suffix(edition),
'image': build_image,
'depends_on': [
'wire-install',
],
'commands': [
'./bin/grabpl test-backend --edition {}'.format(edition),
],
}
def test_backend_integration_step(edition): def test_backend_integration_step(edition):
if edition == 'oss': if edition == 'oss':