gitlab-org--gitlab-foss/lib/gitlab/ci/parsers.rb
Gilbert Roulot e6226e8cb3 Generalise test compare service
It adds a base class for CompareTestReportsService
containing common code with CompareLicenseManagementReportsService
which is present in GitLab Enterprise Edition.
2018-12-11 11:39:22 +01:00

21 lines
459 B
Ruby

# frozen_string_literal: true
module Gitlab
module Ci
module Parsers
ParserNotFoundError = Class.new(ParserError)
def self.parsers
{
junit: ::Gitlab::Ci::Parsers::Test::Junit
}
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