Class: SkillBench::Services::JUnitFormatter

Inherits:
Object
  • Object
show all
Defined in:
lib/skill_bench/services/junit_formatter.rb

Overview

Formats evaluation results as JUnit XML for CI consumption.

Two entry points share the same per-result verdict/score logic: JUnitFormatter.format emits a single-result suite (one ), while JUnitFormatter.format_batch aggregates many results into one suite so a batch skill-bench run --all produces a single JUnit artifact.

Constant Summary collapse

CLASSNAME =

classname attribute applied to every emitted .

'SkillBench'

Class Method Summary collapse

Class Method Details

.format(result) ⇒ String

Format a single result as a JUnit XML document.

Supports both legacy format (result) and modern DeltaReport format.

Parameters:

  • result (Hash)

    Eval result.

Returns:

  • (String)

    JUnit XML-formatted string.



23
24
25
# File 'lib/skill_bench/services/junit_formatter.rb', line 23

def self.format(result)
  suite([result])
end

.format_batch(aggregate) ⇒ String

Format an aggregate batch envelope as one JUnit XML document.

Emits a single with one per result, adding a child for every failing eval.

Parameters:

  • aggregate (Hash)

    Aggregate envelope with a :results array.

Returns:

  • (String)

    JUnit XML-formatted string.



34
35
36
# File 'lib/skill_bench/services/junit_formatter.rb', line 34

def self.format_batch(aggregate)
  suite(aggregate[:results] || [])
end