Revert "Chore: Use proper database type from env in testinfra integration tests" (#109081)
Revert "Chore: Use proper database type from env in testinfra integration tes…"
This reverts commit 772f647210.
This commit is contained in:
@@ -161,21 +161,14 @@ func TestIntegrationProvisioning_CreatingAndGetting(t *testing.T) {
|
||||
// Viewer can see settings listing
|
||||
t.Run("viewer has access to list", func(t *testing.T) {
|
||||
settings := &provisioning.RepositoryViewList{}
|
||||
// Wait for unified storage to make the data available
|
||||
require.Eventually(t, func() bool {
|
||||
rsp := helper.ViewerREST.Get().
|
||||
Namespace("default").
|
||||
Suffix("settings").
|
||||
Do(context.Background())
|
||||
if rsp.Error() != nil {
|
||||
return false
|
||||
}
|
||||
err := rsp.Into(settings)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
return len(settings.Items) == len(inputFiles)
|
||||
}, time.Second*10, time.Millisecond*100, "Expected settings to have len(inputFiles) items")
|
||||
rsp := helper.ViewerREST.Get().
|
||||
Namespace("default").
|
||||
Suffix("settings").
|
||||
Do(context.Background())
|
||||
require.NoError(t, rsp.Error())
|
||||
err := rsp.Into(settings)
|
||||
require.NoError(t, err)
|
||||
require.Len(t, settings.Items, len(inputFiles))
|
||||
|
||||
// FIXME: this should be an enterprise integration test
|
||||
if extensions.IsEnterprise {
|
||||
@@ -1832,10 +1825,8 @@ func TestIntegrationProvisioning_MoveResources(t *testing.T) {
|
||||
|
||||
// Verify dashboard still exists in Grafana with same content but may have updated path references
|
||||
helper.SyncAndWait(t, repo, nil)
|
||||
require.Eventually(t, func() bool {
|
||||
_, err = helper.DashboardsV1.Resource.Get(ctx, allPanelsUID, metav1.GetOptions{})
|
||||
return err == nil
|
||||
}, 10*time.Second, 100*time.Millisecond, "dashboard should still exist in Grafana after move") // Using Eventually to account for potential delays in dashboards APIs.
|
||||
_, err = helper.DashboardsV1.Resource.Get(ctx, allPanelsUID, metav1.GetOptions{})
|
||||
require.NoError(t, err, "dashboard should still exist in Grafana after move")
|
||||
})
|
||||
|
||||
t.Run("move file to nested path without ref", func(t *testing.T) {
|
||||
|
||||
@@ -13,7 +13,6 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/grafana/grafana/pkg/services/featuremgmt"
|
||||
"github.com/grafana/grafana/pkg/services/sqlstore/sqlutil"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
@@ -86,20 +85,6 @@ func StartGrafanaEnv(t *testing.T, grafDir, cfgPath string) (string, *server.Tes
|
||||
|
||||
err = featuremgmt.InitOpenFeatureWithCfg(cfg)
|
||||
require.NoError(t, err)
|
||||
|
||||
// Use proper database type based on the environment variable GRAFANA_TEST_DB in tests
|
||||
testDB, err := sqlutil.GetTestDB(sqlutil.GetTestDBType())
|
||||
require.NoError(t, err)
|
||||
t.Cleanup(testDB.Cleanup)
|
||||
|
||||
dbCfg := cfg.Raw.Section("database")
|
||||
dbCfg.Key("type").SetValue(testDB.DriverName)
|
||||
dbCfg.Key("host").SetValue(testDB.Host)
|
||||
dbCfg.Key("port").SetValue(testDB.Port)
|
||||
dbCfg.Key("user").SetValue(testDB.User)
|
||||
dbCfg.Key("password").SetValue(testDB.Password)
|
||||
dbCfg.Key("name").SetValue(testDB.Database)
|
||||
|
||||
env, err := server.InitializeForTest(t, t, cfg, serverOpts, apiServerOpts)
|
||||
require.NoError(t, err)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user