Class: Specwrk::Web::Endpoints::Report

Inherits:
Base
  • Object
show all
Defined in:
lib/specwrk/web/endpoints/report.rb

Constant Summary

Constants inherited from Base

Base::MUTEX

Instance Attribute Summary

Attributes inherited from Base

#started_at

Instance Method Summary collapse

Methods inherited from Base

#initialize, #response

Constructor Details

This class inherits a constructor from Specwrk::Web::Endpoints::Base

Instance Method Details

#with_responseObject



9
10
11
12
13
14
15
# File 'lib/specwrk/web/endpoints/report.rb', line 9

def with_response
  completed_dump = completed.dump
  completed_dump[:meta][:unexecuted] = pending.length + processing.length
  completed_dump[:flakes] = failure_counts.to_h.reject { |id, _count| completed_dump.dig(:examples, id, :status) == "failed" }

  [200, {"content-type" => "application/json"}, [JSON.generate(completed_dump)]]
end