Files
TradarrV2/backend/internal/scheduler/scheduler_contract_test.go
Blomios 768c0fd7f5 feat(generation): persist summary outcomes without articles
Record generation outcomes and summaries for history while keeping article content transient.

Refs #7

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-20 21:20:35 +01:00

34 lines
777 B
Go

package scheduler
import (
"go/ast"
"go/parser"
"go/token"
"testing"
)
func TestScheduledCycleDoesNotPersistArticlesThroughRegistryRunAll(t *testing.T) {
fset := token.NewFileSet()
file, err := parser.ParseFile(fset, "scheduler.go", nil, 0)
if err != nil {
t.Fatal(err)
}
for _, declaration := range file.Decls {
function, ok := declaration.(*ast.FuncDecl)
if !ok || function.Name.Name != "run" {
continue
}
ast.Inspect(function.Body, func(node ast.Node) bool {
call, ok := node.(*ast.CallExpr)
if !ok {
return true
}
selector, ok := call.Fun.(*ast.SelectorExpr)
if ok && selector.Sel.Name == "RunAll" {
t.Errorf("scheduled generation still invokes Registry.RunAll at %s", fset.Position(call.Pos()))
}
return true
})
}
}