Welcome to mirror list, hosted at ThFree Co, Russian Federation.

test.rb « parsers « ci « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c6bc9662b077e36115cb7176e71fd79f0e9f761d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# frozen_string_literal: true

module Gitlab
  module Ci
    module Parsers
      module Test
        ParserNotFoundError = Class.new(StandardError)

        PARSERS = {
          junit: ::Gitlab::Ci::Parsers::Test::Junit
        }.freeze

        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
end