Add separate production, testserver, and demo deployments
CI / test (push) Failing after 10s

This commit is contained in:
2026-09-14 19:58:31 +02:00
parent b87aa0aa17
commit d06ff4a94a
37 changed files with 1293 additions and 121 deletions
+10 -1
View File
@@ -7,15 +7,24 @@ func TestConfigFromEnvironment(t *testing.T) {
t.Setenv("GARDOMATIC_API_HOST", "127.0.0.1")
t.Setenv("GARDOMATIC_API_PORT", "4100")
t.Setenv("GARDOMATIC_CORS_TRUSTED_ORIGINS", "https://example.com, https://app.example.com")
t.Setenv("GARDOMATIC_DEMO_ACCOUNT_EMAIL", " Demo@Example.com ")
cfg, err := configFromEnvironment()
if err != nil {
t.Fatal(err)
}
if cfg.Host != "127.0.0.1" || cfg.Port != 4100 || len(cfg.Cors.TrustedOrigins) != 2 {
if cfg.Host != "127.0.0.1" || cfg.Port != 4100 || len(cfg.Cors.TrustedOrigins) != 2 || cfg.DemoAccountEmail != "demo@example.com" {
t.Fatalf("unexpected config: %#v", cfg)
}
}
func TestConfigRejectsInvalidDemoAccountEmail(t *testing.T) {
t.Setenv("GARDOMATIC_DB_DSN", "postgres://example")
t.Setenv("GARDOMATIC_DEMO_ACCOUNT_EMAIL", "not-an-email")
if _, err := configFromEnvironment(); err == nil {
t.Fatal("expected invalid demo account email error")
}
}
func TestConfigRequiresDSN(t *testing.T) {
t.Setenv("GARDOMATIC_DB_DSN", "")
if _, err := configFromEnvironment(); err == nil {