Class: FlowApi::Manager

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_api/manager.rb

Class Method Summary collapse

Class Method Details

.junit_file_to_hash(junit_path) ⇒ Object



30
31
32
33
34
# File 'lib/flow_api/manager.rb', line 30

def junit_file_to_hash(junit_path)
  return {} unless File.exist? junit_path
  log_xml = File.read(junit_path)
  Crack::XML.parse(log_xml)
end

.send_test_log_json(file_path) ⇒ Object



36
37
38
39
# File 'lib/flow_api/manager.rb', line 36

def send_test_log_json(file_path)
  json_str = JunitReader.build_json_from_juniter(file_path).to_json
  FlowApi::Rest.send_log_json ENV["FLOW_PROJECT_ID"], ENV["FLOW_JOB_ID"], json_str
end