PoC: replace using testing.Short in storage/unified package with integration test skip method (#107887)

* PoC: check if testing.Short is called from integration tests only.

* Rename helper function.

* Fix logic.

* Remove skipping of integration tests from non-integration tests.

* Remove skipping of integration tests from non-integration tests.

* Fix import.
This commit is contained in:
Peter Štibraný
2025-07-09 15:32:10 +00:00
committed by GitHub
parent 5108225785
commit 9d2eadcfd2
7 changed files with 21 additions and 26 deletions
@@ -17,6 +17,7 @@ import (
"github.com/grafana/grafana/pkg/storage/unified/sql"
"github.com/grafana/grafana/pkg/storage/unified/sql/db/dbimpl"
test "github.com/grafana/grafana/pkg/storage/unified/testing"
"github.com/grafana/grafana/pkg/tests"
)
func newTestBackend(b testing.TB) resource.StorageBackend {
@@ -38,9 +39,7 @@ func newTestBackend(b testing.TB) resource.StorageBackend {
}
func TestIntegrationBenchmarkSQLStorageBackend(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test in short mode")
}
tests.SkipIntegrationTestInShortMode(t)
opts := test.DefaultBenchmarkOptions()
if db.IsTestDbSQLite() {
opts.Concurrency = 1 // to avoid SQLite database is locked error
@@ -49,9 +48,7 @@ func TestIntegrationBenchmarkSQLStorageBackend(t *testing.T) {
}
func TestIntegrationBenchmarkResourceServer(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test in short mode")
}
tests.SkipIntegrationTestInShortMode(t)
ctx := context.Background()
opts := &test.BenchmarkOptions{