Spanner support enhancements (#101634)

* Adds ability to run integration tests against spanner (by using GRAFANA_TEST_DB=spanner env variable. SPANNER_DB variable then specifies database to use: spannertest, emulator or string like /projects/<project>/instances/<instance>/databases/<db>)
* Adds feature to migration dialects to create database from a snapshot, instead of running individual migrations.
* Adds first version of Spanner snapshot, prepared from "OSS" migrations.
* Uses generated bit-reversed-positive values instead of auto_increment. (As an experiment)
This commit is contained in:
Peter Štibraný
2025-03-06 16:11:20 +01:00
committed by GitHub
parent 43f56c5ca1
commit 9e690bd620
18 changed files with 1477 additions and 86 deletions
@@ -13,6 +13,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gopkg.in/ini.v1"
"xorm.io/xorm"
. "github.com/grafana/grafana/pkg/services/sqlstore/migrator"
@@ -76,7 +77,8 @@ func TestIntegrationMigrationLock(t *testing.T) {
}
dbType := sqlutil.GetTestDBType()
if dbType == SQLite {
// skip for SQLite and Spanner since there is no database locking (only migrator locking)
if dbType == SQLite || dbType == Spanner {
t.Skip()
}
@@ -233,8 +235,8 @@ func TestMigratorLocking(t *testing.T) {
func TestDatabaseLocking(t *testing.T) {
dbType := sqlutil.GetTestDBType()
// skip for SQLite since there is no database locking (only migrator locking)
if dbType == SQLite {
// skip for SQLite and Spanner since there is no database locking (only migrator locking)
if dbType == SQLite || dbType == Spanner {
t.Skip()
}