forked from mtusi2026/mtusi2026lab3
Реализовать lab3 в общем Helm-релизе с Traefik, TLS и HPA
This commit is contained in:
@@ -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")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user