19 lines
833 B
Go
19 lines
833 B
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
)
|
|
|
|
func TestQAOpsConnectionFailureIsContainedOutsideMainDatabase(t *testing.T) {
|
|
reader, settings := openQAOperations(context.Background(), func(string) string { return "" }, "postgres://main@host/governance")
|
|
if reader != nil || settings.Enabled || settings.Problem != "" {
|
|
t.Fatal("QA operations must be disabled by default")
|
|
}
|
|
env := map[string]string{"DOBOTAI_OPS_READ_ENABLED": "true", "DOBOTAI_OPS_TENANT_KEY": "approved-tenant", "DOBOTAI_OPS_READ_DSN_FILE": "/nonexistent-qaops-fixture-secret"}
|
|
reader, settings = openQAOperations(context.Background(), func(k string) string { return env[k] }, "postgres://main@host/governance")
|
|
if reader != nil || !settings.Enabled || settings.Problem == "" {
|
|
t.Fatal("failed external connection must be a contained module error")
|
|
}
|
|
}
|