2019-02-15 15:39:39 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Gitlab
|
|
|
|
module Ci
|
|
|
|
module Parsers
|
|
|
|
ParserNotFoundError = Class.new(ParserError)
|
|
|
|
|
|
|
|
def self.parsers
|
|
|
|
{
|
2020-04-08 14:13:33 +05:30
|
|
|
junit: ::Gitlab::Ci::Parsers::Test::Junit,
|
2020-05-24 23:13:21 +05:30
|
|
|
cobertura: ::Gitlab::Ci::Parsers::Coverage::Cobertura,
|
|
|
|
terraform: ::Gitlab::Ci::Parsers::Terraform::Tfplan,
|
|
|
|
accessibility: ::Gitlab::Ci::Parsers::Accessibility::Pa11y
|
2019-02-15 15:39:39 +05:30
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.fabricate!(file_type)
|
|
|
|
parsers.fetch(file_type.to_sym).new
|
|
|
|
rescue KeyError
|
|
|
|
raise ParserNotFoundError, "Cannot find any parser matching file type '#{file_type}'"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2020-05-24 23:13:21 +05:30
|
|
|
|
|
|
|
Gitlab::Ci::Parsers.prepend_if_ee('::EE::Gitlab::Ci::Parsers')
|