Class: Ace::Test::EndToEndRunner::Molecules::SuiteReportWriter
- Inherits:
-
Object
- Object
- Ace::Test::EndToEndRunner::Molecules::SuiteReportWriter
- Defined in:
- lib/ace/test/end_to_end_runner/molecules/suite_report_writer.rb
Overview
Writes an aggregated package or suite report
Uses LLM synthesis to generate rich reports with root cause analysis, friction insights, and improvement suggestions. Falls back to a static template on LLM failure.
Constant Summary collapse
- REPORT_KINDS =
{ package: ->(, package) { "#{}-#{package}-report.md" }, suite: ->(, _package) { "#{}-suite-report.md" } }.freeze
Instance Method Summary collapse
-
#initialize(config: nil) ⇒ SuiteReportWriter
constructor
A new instance of SuiteReportWriter.
-
#write(results, scenarios, package:, timestamp:, base_dir:, report_kind: :package, diagnostics: nil) ⇒ String
Write an aggregated report.
Constructor Details
#initialize(config: nil) ⇒ SuiteReportWriter
Returns a new instance of SuiteReportWriter.
22 23 24 25 26 |
# File 'lib/ace/test/end_to_end_runner/molecules/suite_report_writer.rb', line 22 def initialize(config: nil) reporting = (config || {}).dig("reporting") || {} @model = reporting["model"] || "glite" @timeout = reporting["timeout"] || 60 end |
Instance Method Details
#write(results, scenarios, package:, timestamp:, base_dir:, report_kind: :package, diagnostics: nil) ⇒ String
Write an aggregated report
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/ace/test/end_to_end_runner/molecules/suite_report_writer.rb', line 41 def write(results, scenarios, package:, timestamp:, base_dir:, report_kind: :package, diagnostics: nil) cache_dir = File.join(base_dir, ".ace-local", "test-e2e") FileUtils.mkdir_p(cache_dir) report_path = File.join(cache_dir, report_filename(report_kind, , package)) overall_status = compute_status(results) executed_at = Time.now.utc.strftime("%Y-%m-%dT%H:%M:%SZ") results_data = build_results_data(results, scenarios) narrative_sections = synthesize_narrative_sections( results_data, package: package, timestamp: , overall_status: overall_status, executed_at: executed_at ) content = build_report( results_data, package: package, timestamp: , overall_status: overall_status, executed_at: executed_at, narrative_sections: narrative_sections, diagnostics: diagnostics ) File.write(report_path, content) report_path end |