Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions cmd/opencodereview/budget_output_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func TestEmitRunResult_JSONBudgetStopIsPartial(t *testing.T) {
},
}
got := captureStdout(t, func() {
err := emitRunResult(context.Background(), ag, nil, time.Now(), "json", "developer", nil, nil)
err := emitRunResult(context.Background(), ag, nil, time.Now(), "json", "developer", nil, nil, nil)
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
Expand Down Expand Up @@ -96,7 +96,7 @@ func TestEmitRunResult_JSONBudgetDoesNotOverrideLegacyStatus(t *testing.T) {
budgetExceeded: true,
}
got := captureStdout(t, func() {
err := emitRunResult(context.Background(), ag, nil, time.Now(), "json", "developer", nil, nil)
err := emitRunResult(context.Background(), ag, nil, time.Now(), "json", "developer", nil, nil, nil)
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
Expand Down Expand Up @@ -124,7 +124,7 @@ func TestEmitRunResult_JSONNoBudgetIsSuccess(t *testing.T) {
totalTokens: 15,
}
got := captureStdout(t, func() {
err := emitRunResult(context.Background(), ag, nil, time.Now(), "json", "developer", nil, nil)
err := emitRunResult(context.Background(), ag, nil, time.Now(), "json", "developer", nil, nil, nil)
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
Expand Down Expand Up @@ -154,7 +154,7 @@ func TestEmitFailureUsage_TextEmitsStructuredRecord(t *testing.T) {
sessionID: "sess-fail-1",
}
got := captureStderr(t, func() {
emitFailureUsage(ag, 42*time.Second, "text", nil)
emitFailureUsage(ag, 42*time.Second, "text", nil, nil)
})
for _, want := range []string{"usage on failure", "1500 total tokens", "5 tool calls", "budget_exceeded=false", "sess-fail-1"} {
if !strings.Contains(got, want) {
Expand All @@ -175,7 +175,7 @@ func TestEmitFailureUsage_JSONEmitsStructuredRecord(t *testing.T) {
}
identity := &jsonLLMIdentity{Provider: "openai", Model: "gpt-5.4"}
got := captureStderr(t, func() {
emitFailureUsage(ag, 5*time.Second, "json", identity)
emitFailureUsage(ag, 5*time.Second, "json", identity, nil)
})
var out jsonOutput
if err := json.Unmarshal([]byte(got), &out); err != nil {
Expand Down Expand Up @@ -215,7 +215,7 @@ func TestEmitFailureUsage_BudgetExceededPropagated(t *testing.T) {
budgetExceeded: true,
}
got := captureStderr(t, func() {
emitFailureUsage(ag, 3*time.Second, "text", nil)
emitFailureUsage(ag, 3*time.Second, "text", nil, nil)
})
if !strings.Contains(got, "budget_exceeded=true") {
t.Errorf("text failure record must reflect budget_exceeded=true; got %q", got)
Expand All @@ -228,7 +228,7 @@ func TestEmitFailureUsage_BudgetExceededPropagated(t *testing.T) {
budgetExceeded: true,
}
gotJSON := captureStderr(t, func() {
emitFailureUsage(ag2, 3*time.Second, "json", nil)
emitFailureUsage(ag2, 3*time.Second, "json", nil, nil)
})
var out jsonOutput
if err := json.Unmarshal([]byte(gotJSON), &out); err != nil {
Expand All @@ -249,7 +249,7 @@ func TestEmitRunResult_BudgetExceededFalseOmittedFromJSON(t *testing.T) {
totalTokens: 10,
}
got := captureStdout(t, func() {
err := emitRunResult(context.Background(), ag, []model.LlmComment{}, time.Now(), "json", "developer", nil, nil)
err := emitRunResult(context.Background(), ag, []model.LlmComment{}, time.Now(), "json", "developer", nil, nil, nil)
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
Expand Down
Loading