Class: SkillBench::Cli::BatchResultPrinter

Inherits:
Object
  • Object
show all
Defined in:
lib/skill_bench/cli/batch_result_printer.rb

Overview

Prints the aggregate result of a batch skill-bench run --all command.

Defaults to the human-readable batch summary, but can instead emit a JUnit document (format: :junit) or a JSON gate (summary: true). The returned exit code is always OutputFormatter.batch_exit_code, so CI gating works identically across every output mode.

Class Method Summary collapse

Class Method Details

.call(aggregate, format: nil, summary: false) ⇒ Integer

Prints the aggregate summary and returns the appropriate exit code.

Parameters:

  • aggregate (Hash)

    Aggregate envelope from BatchRunnerService.

  • format (Symbol, nil) (defaults to: nil)

    Output format (:junit for JUnit XML, else human).

  • summary (Boolean) (defaults to: false)

    When true, print the JSON summary gate instead.

Returns:

  • (Integer)

    Exit code (0 when all pass, 1 when any fails).



21
22
23
24
# File 'lib/skill_bench/cli/batch_result_printer.rb', line 21

def self.call(aggregate, format: nil, summary: false)
  puts batch_output(aggregate, format: format, summary: summary)
  OutputFormatter.batch_exit_code(aggregate)
end