Add database config

This commit is contained in:
dwrz
2026-09-20 12:27:03 +00:00
parent 7e46c3e429
commit 19aed53fee
2 changed files with 66 additions and 0 deletions
+44
View File
@@ -14,6 +14,9 @@ func validConfig() string {
address: ":9090"
shutdown_timeout: "60s"
database:
path: "/tmp/odidere-test.db"
default_model:
provider: testprovider
model: test-model
@@ -76,6 +79,9 @@ func TestLoad(t *testing.T) {
{
name: "defaults applied",
config: `
database:
path: "/tmp/odidere-test.db"
default_model:
provider: testprovider
model: test-model
@@ -115,6 +121,9 @@ tts:
{
name: "env expansion",
config: `
database:
path: "/tmp/odidere-test.db"
default_model:
provider: testprovider
model: test-model
@@ -149,6 +158,9 @@ tts:
{
name: "env expansion unset var becomes empty",
config: `
database:
path: "/tmp/odidere-test.db"
default_model:
provider: testprovider
model: test-model
@@ -182,6 +194,29 @@ tts:
config: `providers: [invalid yaml`,
shouldErr: true,
},
{
name: "missing database path",
config: `
address: ":9090"
shutdown_timeout: "60s"
default_model:
provider: testprovider
model: test-model
providers:
- name: testprovider
url: http://localhost:8080
stt:
url: http://localhost:8178
tts:
url: http://localhost:8880
voice: af_heart
`,
shouldErr: true,
},
{
name: "invalid shutdown_timeout",
config: `
@@ -322,6 +357,9 @@ tts:
{
name: "config with tools",
config: `
database:
path: "/tmp/odidere-test.db"
default_model:
provider: testprovider
model: test-model
@@ -462,6 +500,9 @@ func TestLoad_Jobs(t *testing.T) {
{
name: "valid job config",
config: `
database:
path: "/tmp/odidere-test.db"
default_model:
provider: testprovider
model: test-model
@@ -514,6 +555,9 @@ jobs:
{
name: "job with minimal config (defaults)",
config: `
database:
path: "/tmp/odidere-test.db"
default_model:
provider: testprovider
model: test-model