Change testing.Short() check with SkipIntegrationTestInShortMode check. (#112442)

* Change testing.Short() check with SkipIntegrationTestInShortMode check.
This commit is contained in:
Peter Štibraný
2025-10-20 09:40:38 +02:00
committed by GitHub
parent 891d5f0625
commit 7604653fd8
8 changed files with 26 additions and 62 deletions
@@ -17,6 +17,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/tsdb/grafana-postgresql-datasource/sqleng"
"github.com/grafana/grafana/pkg/util/testutil"
)
// These tests require a real postgres database:
@@ -28,12 +29,10 @@ import (
// Use the docker/blocks/postgres_tests/docker-compose.yaml to spin up a
// preconfigured Postgres server suitable for running these tests.
func TestIntegrationPostgresPGXSnapshots(t *testing.T) {
testutil.SkipIntegrationTestInShortMode(t)
// the logic in this function is copied from postgres_tests.go
shouldRunTest := func() bool {
if testing.Short() {
return false
}
testDbName, present := os.LookupEnv("GRAFANA_TEST_DB")
if present && testDbName == "postgres" {
@@ -35,10 +35,6 @@ func TestIntegrationPostgresSnapshots(t *testing.T) {
// the logic in this function is copied from postgres_tests.go
shouldRunTest := func() bool {
if testing.Short() {
return false
}
testDbName, present := os.LookupEnv("GRAFANA_TEST_DB")
if present && testDbName == "postgres" {