21 lines
727 B
Go
21 lines
727 B
Go
package semantic_evolution_test
|
|
|
|
import (
|
|
"os"
|
|
"strings"
|
|
"testing"
|
|
)
|
|
|
|
func TestGovernedDevelopmentCandidateMigrationIsWorkOwnedAndSandboxed(t *testing.T) {
|
|
payload, err := os.ReadFile("../../database/migrations/043_governed_development_candidates.sql")
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
source := strings.ToLower(string(payload))
|
|
for _, fragment := range []string{"set role work_role", "create table if not exists work.extension_proposals", "create table if not exists work.development_scaffolds", "stage = 'sandboxed'", "protected_main_access = 'denied'", "production_access = 'denied'", "secret_access = 'denied'"} {
|
|
if !strings.Contains(source, fragment) {
|
|
t.Fatalf("migration is missing %q", fragment)
|
|
}
|
|
}
|
|
}
|