feat: simplify SOP to immediate-effect configuration
This commit is contained in:
@@ -72,6 +72,34 @@ func TestLoadProductionRequiresEnvironmentSecrets(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestLoadMultiTableEnvironmentConfiguration(t *testing.T) {
|
||||
dir := writeConfigs(t, "")
|
||||
t.Setenv("APP_MULTITABLE_ENABLED", "true")
|
||||
t.Setenv("APP_MULTITABLE_API_KEY", "test-key")
|
||||
for key, value := range map[string]string{
|
||||
"APP_MULTITABLE_TABLES_SCENARIOS": "46",
|
||||
"APP_MULTITABLE_TABLES_SCENARIO_FIELDS": "47",
|
||||
"APP_MULTITABLE_TABLES_SCENARIO_RULES": "54",
|
||||
"APP_MULTITABLE_TABLES_SOP_VERSIONS": "48",
|
||||
"APP_MULTITABLE_TABLES_SOP_NODES": "49",
|
||||
"APP_MULTITABLE_TABLES_SOP_EDGES": "50",
|
||||
"APP_MULTITABLE_TABLES_KNOWLEDGE_VERSIONS": "51",
|
||||
"APP_MULTITABLE_TABLES_KNOWLEDGE_ITEMS": "55",
|
||||
"APP_MULTITABLE_TABLES_KNOWLEDGE_RELATIONS": "56",
|
||||
"APP_MULTITABLE_TABLES_RUNS": "52",
|
||||
"APP_MULTITABLE_TABLES_FEEDBACK": "53",
|
||||
} {
|
||||
t.Setenv(key, value)
|
||||
}
|
||||
cfg, err := Load(LoadOptions{ConfigDir: dir})
|
||||
if err != nil {
|
||||
t.Fatalf("Load() error = %v", err)
|
||||
}
|
||||
if !cfg.MultiTable.Enabled || cfg.MultiTable.Tables.Scenarios != 46 || cfg.MultiTable.Tables.ScenarioRules != 54 || cfg.MultiTable.Tables.KnowledgeItems != 55 || cfg.MultiTable.Tables.KnowledgeRelations != 56 || cfg.MultiTable.Tables.Feedback != 53 {
|
||||
t.Fatalf("unexpected multitable configuration: %+v", cfg.MultiTable)
|
||||
}
|
||||
}
|
||||
|
||||
func writeConfigs(t *testing.T, profile string) string {
|
||||
t.Helper()
|
||||
dir := t.TempDir()
|
||||
|
||||
Reference in New Issue
Block a user