class Gitlab::QA::Report::JsonTestResults

Public Instance Methods

write() click to toggle source
# File lib/gitlab/qa/report/json_test_results.rb, line 9
def write
  json = results.merge('examples' => testcases.map(&:report))

  File.write(path, JSON.pretty_generate(json))
end

Private Instance Methods

parse() click to toggle source
# File lib/gitlab/qa/report/json_test_results.rb, line 17
def parse
  JSON.parse(File.read(path))
end
process() click to toggle source
# File lib/gitlab/qa/report/json_test_results.rb, line 21
def process
  results['examples'].map do |test|
    TestResult.from_json(test)
  end
end