Source identity
| Field | Recorded value |
|---|---|
| Source type | GitHub source |
| Original record | Janady13/missionmatch / internal/platform/database/roles_test.go |
| Date | Not specified in source |
| Repository | Janady13/missionmatch |
| Revision | 720d47fae476b0d38477ae4401697d372b1ea2bc |
| Branch | feature/opportunity-to-outcome |
| Path or archive member | internal/platform/database/roles_test.go |
| Original SHA-256 | bcd6d4441cf09aad710e9ce6d5a7e6a5b116b1976c1d274e0a07dd711fedb85f |
| Git blob SHA | 2e4b17a2d5f40ce6e75ca98efa74c9a4646ac394 |
| Reading-copy SHA-256 | bcd6d4441cf09aad710e9ce6d5a7e6a5b116b1976c1d274e0a07dd711fedb85f |
Recovered source transcript
Download complete source text ↓31 lines · 1.1 KB
package database
import "testing"
// PRODUCTION MUST NOT NEED THE VARIABLE. The defaults are the production role names, so an environment that
// sets nothing behaves exactly as it did before these were resolvable. A regression here would change what
// production asserts, which is the one thing this change must not do.
func TestDefaultsAreTheProductionRoleNames(t *testing.T) {
t.Setenv("MM_APP_DB_ROLE", "")
t.Setenv("MM_COMPLIANCE_DB_ROLE", "")
t.Setenv("MM_AIOE_DB_ROLE", "")
for _, c := range []struct {
got, want string
}{
{AppRoleName(), "missionmatch_app"},
{ComplianceRoleName(), "missionmatch_compliance"},
{AIOERoleName(), "missionmatch_aioe"},
} {
if c.got != c.want {
t.Errorf("role name = %q, want %q. Production asserts this name and sets no variable.", c.got, c.want)
}
}
}
func TestTheVariableOverrides(t *testing.T) {
t.Setenv("MM_APP_DB_ROLE", "missionmatch_staging_app")
if got := AppRoleName(); got != "missionmatch_staging_app" {
t.Fatalf("role name = %q, want the override. Staging cannot run a single batch job without this.", got)
}
}