Build: clean up and document integration test convention (#58170)

* clean up and document integration test convention

* clarify integration test conventions

* clean up integration tests that don't follow convention

* mark testIntegration* functions as helpers to avoid confusion
This commit is contained in:
Dan Cech
2022-11-04 10:14:21 -04:00
committed by GitHub
parent 428dd54094
commit 9ea6a43089
36 changed files with 168 additions and 25 deletions

View File

@@ -8,6 +8,9 @@ import (
)
func TestIntegrationSQLxApiKeyDataAccess(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
testIntegrationApiKeyDataAccess(t, func(ss db.DB, cfg *setting.Cfg) store {
return &sqlxStore{sess: ss.GetSqlxSession(), cfg: cfg}
})

View File

@@ -53,9 +53,8 @@ func seedApiKeys(t *testing.T, store store, num int) {
}
func testIntegrationApiKeyDataAccess(t *testing.T, fn getStore) {
if testing.Short() {
t.Skip("skipping integration test")
}
t.Helper()
mockTimeNow()
defer resetTimeNow()

View File

@@ -8,6 +8,9 @@ import (
)
func TestIntegrationXORMApiKeyDataAccess(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
testIntegrationApiKeyDataAccess(t, func(ss db.DB, cfg *setting.Cfg) store {
return &sqlStore{db: ss, cfg: cfg}
})