Реализовать lab3 в общем Helm-релизе с Traefik, TLS и HPA

This commit is contained in:
Vladislav Agapov
2026-10-16 11:51:20 +03:00
parent a57cbcf329
commit 9494547300
88 changed files with 1922 additions and 255 deletions
+18
View File
@@ -46,3 +46,21 @@ func TestReadinessStopsAtUnavailableDatabase(t *testing.T) {
t.Fatal("closed database reported ready")
}
}
// TestMigrationCommandRejectsMissingConfiguration fails before opening a database.
func TestMigrationCommandRejectsMissingConfiguration(t *testing.T) {
t.Setenv("DATABASE_URL", "")
t.Setenv("VALKEY_SHARDS", "shard0=localhost:6379")
if err := run([]string{"migrate"}); err == nil {
t.Fatal("missing database configuration accepted")
}
}
// TestMigrationCommandRejectsMalformedDatabaseURL fails without logging credentials.
func TestMigrationCommandRejectsMalformedDatabaseURL(t *testing.T) {
t.Setenv("DATABASE_URL", "://invalid")
t.Setenv("VALKEY_SHARDS", "shard0=localhost:6379")
if err := run([]string{"migrate"}); err == nil {
t.Fatal("malformed database configuration accepted")
}
}