Class: Gitlab::Ci::Parsers::Coverage::Cobertura

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/ci/parsers/coverage/cobertura.rb

Constant Summary collapse

CoberturaParserError =
Class.new(Gitlab::Ci::Parsers::ParserError)

Instance Method Summary collapse

Instance Method Details

#parse!(xml_data, coverage_report) ⇒ Object


10
11
12
13
14
15
16
17
18
# File 'lib/gitlab/ci/parsers/coverage/cobertura.rb', line 10

def parse!(xml_data, coverage_report)
  root = Hash.from_xml(xml_data)

  parse_all(root, coverage_report)
rescue Nokogiri::XML::SyntaxError
  raise CoberturaParserError, "XML parsing failed"
rescue
  raise CoberturaParserError, "Cobertura parsing failed"
end