sql: removed dependency on test-db-check (#78717)

This commit is contained in:
Gábor Farkas
2023-11-28 12:46:01 +01:00
committed by GitHub
parent 6e4418ffd2
commit 4f899e3576
2 changed files with 20 additions and 4 deletions
+10 -2
View File
@@ -4,6 +4,7 @@ import (
"context"
"fmt"
"math/rand"
"os"
"strings"
"testing"
"time"
@@ -13,7 +14,6 @@ import (
"github.com/stretchr/testify/require"
"xorm.io/xorm"
"github.com/grafana/grafana/pkg/infra/db"
"github.com/grafana/grafana/pkg/services/sqlstore/sqlutil"
"github.com/grafana/grafana/pkg/setting"
"github.com/grafana/grafana/pkg/tsdb/sqleng"
@@ -35,7 +35,7 @@ func TestIntegrationMySQL(t *testing.T) {
runMySQLTests := false
// runMySqlTests := true
if !(db.IsTestDbMySQL() || runMySQLTests) {
if !(isTestDbMySQL() || runMySQLTests) {
t.Skip()
}
@@ -1321,3 +1321,11 @@ func genTimeRangeByInterval(from time.Time, duration time.Duration, interval tim
return timeRange
}
func isTestDbMySQL() bool {
if db, present := os.LookupEnv("GRAFANA_TEST_DB"); present {
return db == "mysql"
}
return false
}