Adopt Audita v2 configuration and subprocess contract
This commit is contained in:
@@ -229,7 +229,7 @@ seriatim:
|
||||
binary: ` + seriatimBinary + `
|
||||
audita:
|
||||
binary: ` + auditaBinary + `
|
||||
llm_api_key: OPENROUTER_API_KEY
|
||||
credentials: [OPENROUTER_API_KEY]
|
||||
notification:
|
||||
mode: noop
|
||||
`
|
||||
@@ -778,10 +778,18 @@ func TestAuditaAppHelper(t *testing.T) {
|
||||
os.Exit(2)
|
||||
}
|
||||
processArgs := args[start:]
|
||||
if len(processArgs) < 2 || processArgs[0] != "process" {
|
||||
_, _ = os.Stderr.WriteString("expected Audita v2 process invocation\n")
|
||||
os.Exit(2)
|
||||
}
|
||||
for _, arg := range processArgs {
|
||||
if arg == "--report-json" || arg == "--work-dir" || arg == "--debug" || arg == "--reporting=false" {
|
||||
_, _ = os.Stderr.WriteString("retired or unwanted Audita flag\n")
|
||||
os.Exit(2)
|
||||
}
|
||||
}
|
||||
|
||||
outputPath := appSeriatimFlagValue(processArgs, "--output")
|
||||
reportPath := appSeriatimFlagValue(processArgs, "--report-json")
|
||||
workDir := appSeriatimFlagValue(processArgs, "--work-dir")
|
||||
if strings.TrimSpace(outputPath) == "" {
|
||||
_, _ = os.Stderr.WriteString("missing --output\n")
|
||||
os.Exit(2)
|
||||
@@ -794,19 +802,9 @@ func TestAuditaAppHelper(t *testing.T) {
|
||||
_, _ = os.Stderr.WriteString(fmt.Sprintf("write output: %v\n", err))
|
||||
os.Exit(2)
|
||||
}
|
||||
if strings.TrimSpace(reportPath) != "" {
|
||||
if err := os.MkdirAll(filepath.Dir(reportPath), 0o755); err != nil {
|
||||
_, _ = os.Stderr.WriteString(fmt.Sprintf("mkdir report dir: %v\n", err))
|
||||
os.Exit(2)
|
||||
}
|
||||
if err := os.WriteFile(reportPath, []byte(`{"report":true}`), 0o644); err != nil {
|
||||
_, _ = os.Stderr.WriteString(fmt.Sprintf("write report: %v\n", err))
|
||||
os.Exit(2)
|
||||
}
|
||||
}
|
||||
if strings.TrimSpace(workDir) != "" {
|
||||
if err := os.MkdirAll(workDir, 0o755); err != nil {
|
||||
_, _ = os.Stderr.WriteString(fmt.Sprintf("mkdir work dir: %v\n", err))
|
||||
for _, name := range []string{"errors.yml", "recoveries.yml", "report.md"} {
|
||||
if err := os.WriteFile(filepath.Join(filepath.Dir(outputPath), name), []byte("status: completed\n"), 0o644); err != nil {
|
||||
_, _ = os.Stderr.WriteString(fmt.Sprintf("write %s: %v\n", name, err))
|
||||
os.Exit(2)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user