Skip to content

Commit

Permalink
Replace hana db plugin with mysql in tests
Browse files Browse the repository at this point in the history
This replaces one instance of hanadb with MySQL in the test suite
instead, as hanadb has been removed but MySQL (MariaDB) has been
retained.

Cherry-pick of a1a2f14.

Signed-off-by: Alexander Scheel <alexander.m.scheel@gmail.com>
  • Loading branch information
cipherboy authored and naphelps committed Feb 2, 2024
1 parent c298b8d commit 96093ad
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion builtin/logical/database/backend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1511,7 +1511,7 @@ func TestBackend_AsyncClose(t *testing.T) {
func TestNewDatabaseWrapper_IgnoresBuiltinVersion(t *testing.T) {
cluster, sys := getCluster(t)
t.Cleanup(cluster.Cleanup)
_, err := newDatabaseWrapper(context.Background(), "hana-database-plugin", "v1.0.0+builtin", sys, hclog.Default())
_, err := newDatabaseWrapper(context.Background(), "mysql-database-plugin", "v1.0.0+builtin", sys, hclog.Default())
if err != nil {
t.Fatal(err)
}
Expand Down
16 changes: 8 additions & 8 deletions builtin/logical/database/path_config_connection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ func TestWriteConfig_PluginVersionInStorage(t *testing.T) {
}
defer b.Cleanup(context.Background())

const hdb = "hana-database-plugin"
hdbBuiltin := versions.GetBuiltinVersion(consts.PluginTypeDatabase, hdb)
const mdb = "mysql-database-plugin"
mdbBuiltin := versions.GetBuiltinVersion(consts.PluginTypeDatabase, mdb)

// Configure a connection
writePluginVersion := func() {
Expand All @@ -40,8 +40,8 @@ func TestWriteConfig_PluginVersionInStorage(t *testing.T) {
Storage: config.StorageView,
Data: map[string]interface{}{
"connection_url": "test",
"plugin_name": hdb,
"plugin_version": hdbBuiltin,
"plugin_name": mdb,
"plugin_version": mdbBuiltin,
"verify_connection": false,
},
}
Expand Down Expand Up @@ -75,8 +75,8 @@ func TestWriteConfig_PluginVersionInStorage(t *testing.T) {
// Directly store config to get the builtin plugin version into storage,
// simulating a write that happened before upgrading to 1.12.2+
err = storeConfig(context.Background(), config.StorageView, "plugin-test", &DatabaseConfig{
PluginName: hdb,
PluginVersion: hdbBuiltin,
PluginName: mdb,
PluginVersion: mdbBuiltin,
})
if err != nil {
t.Fatal(err)
Expand Down Expand Up @@ -107,8 +107,8 @@ func TestWriteConfig_PluginVersionInStorage(t *testing.T) {
}

storagePluginVersion := getPluginVersionFromStorage()
if storagePluginVersion != hdbBuiltin {
t.Fatalf("Expected %s, got: %s", hdbBuiltin, storagePluginVersion)
if storagePluginVersion != mdbBuiltin {
t.Fatalf("Expected %s, got: %s", mdbBuiltin, storagePluginVersion)
}

// Trigger a write to storage, which should clean up plugin version in the storage entry.
Expand Down

0 comments on commit 96093ad

Please sign in to comment.