Support creating temporary Spanner databases for integration tests. (#103347)
* Support creating temporary Spanner databases for integration tests.
This commit is contained in:
@@ -5,12 +5,13 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/grafana/grafana/pkg/registry"
|
||||
"github.com/grafana/grafana/pkg/services/org"
|
||||
"github.com/grafana/grafana/pkg/services/sqlstore"
|
||||
"github.com/grafana/grafana/pkg/services/sqlstore/migrator"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
"xorm.io/xorm"
|
||||
)
|
||||
|
||||
@@ -23,7 +24,7 @@ func TestIntegrationTempDatabaseConnect(t *testing.T) {
|
||||
|
||||
sqlStore := sqlstore.NewTestStore(t, sqlstore.WithoutMigrator())
|
||||
err := sqlStore.WithDbSession(context.Background(), func(sess *sqlstore.DBSession) error {
|
||||
_, err := sess.Exec("SELECT 1")
|
||||
_, err := sess.Query("SELECT 1")
|
||||
return err
|
||||
})
|
||||
require.NoError(t, err, "failed to execute a SELECT 1")
|
||||
|
||||
Reference in New Issue
Block a user