package main import "strings" func init() { register(Check{ Seq: 31, ID: "3b", Title: "Orchestrator backend tests", Run: func(ctx *ScanContext, rep *Reporter) { var orchestratorTestTargets []goTestTarget if ctx.orchestratorOnly { orchestratorTestTargets = discoverOrchestratorTestTargetsFromRoot(orchestratorRepoRoot()) } else { orchestratorTestTargets = discoverOrchestratorTestTargets(ctx.repoRoot, ctx.backendDir, ctx.includeCoreTargets) } if len(orchestratorTestTargets) > 0 { completedOrchestratorTargets, orchestratorFailures, orchestratorErr := runGoTestTargets(orchestratorTestTargets) if orchestratorErr != nil { rep.Fatal("failed to run orchestrator tests: %v", orchestratorErr) } if len(orchestratorFailures) > 0 { rep.Fail("%d orchestrator test target(s) failed", len(orchestratorFailures)) for _, failure := range orchestratorFailures { rep.Findingf("[%s] %s", failure.stage, failure.target) if failure.output != "" { for line := range strings.SplitSeq(failure.output, "\n") { rep.Findingf(" %s", line) } } } } else { rep.OK("Orchestrator tests clean for %d target(s)", len(completedOrchestratorTargets)) } } else { rep.Skip("orchestrator backend not found or not part of this scan") } }, }) }