jenkins
This commit is contained in:
@@ -54,6 +54,23 @@ func TestInitializationStateTracksRealDatabaseConnection(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestPersistedDatabaseConfiguredReadsSharedRuntimeConfig(t *testing.T) {
|
||||
configPath := filepath.Join(t.TempDir(), "config.yaml")
|
||||
if err := os.WriteFile(configPath, []byte("data:\n database:\n driver: mysql\n name: kra\n"), 0o600); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
runtime := config.NewStore(&config.Config{Admin: &config.Admin{ConfigPath: configPath}})
|
||||
if !persistedDatabaseConfigured(runtime) {
|
||||
t.Fatal("persisted database configuration was not detected")
|
||||
}
|
||||
if err := os.WriteFile(configPath, []byte("data:\n database:\n driver: mysql\n name: \"\"\n"), 0o600); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if persistedDatabaseConfigured(runtime) {
|
||||
t.Fatal("empty persisted database configuration was treated as initialized")
|
||||
}
|
||||
}
|
||||
|
||||
func TestPersistDatabaseConfigPreservesTemplateAndRotatesJWTKey(t *testing.T) {
|
||||
root := t.TempDir()
|
||||
configPath := filepath.Join(root, "config.yaml")
|
||||
|
||||
Reference in New Issue
Block a user