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
+3 -4
View File
@@ -40,6 +40,7 @@ import (
"github.com/grafana/grafana/pkg/storage/unified/resourcepb"
"github.com/grafana/grafana/pkg/storage/unified/sql"
"github.com/grafana/grafana/pkg/storage/unified/sql/db/dbimpl"
"github.com/grafana/grafana/pkg/tests"
"github.com/grafana/grafana/pkg/tests/testsuite"
)
@@ -134,9 +135,7 @@ func testSetup(t testing.TB, opts ...setupOption) (context.Context, storage.Inte
_, err = server.IsHealthy(ctx, &resourcepb.HealthCheckRequest{})
require.NoError(t, err)
case StorageTypeUnified:
if testing.Short() {
t.Skip("skipping integration test")
}
tests.SkipIntegrationTestInShortMode(t)
dbstore := infraDB.InitTestDB(t)
cfg := setting.NewCfg()
@@ -190,7 +189,7 @@ func testSetup(t testing.TB, opts ...setupOption) (context.Context, storage.Inte
return ctx, store, destroyFunc, nil
}
func TestWatch(t *testing.T) {
func TestIntegrationWatch(t *testing.T) {
for _, s := range []StorageType{StorageTypeFile, StorageTypeUnified} {
t.Run(string(s), func(t *testing.T) {
ctx, store, destroyFunc, err := testSetup(t, withStorageType(s))