diff options
author | Gilbert Roulot <groulot@gitlab.com> | 2018-11-05 14:45:36 +0100 |
---|---|---|
committer | Kamil TrzciĆski <ayufan@ayufan.eu> | 2018-12-11 11:39:22 +0100 |
commit | e6226e8cb3d7e79500482ba2cef604133f667381 (patch) | |
tree | acf0f3d0b822f122da9125333f210ccce477c0d0 /lib/gitlab/ci/parsers | |
parent | 85f430cb3cde4ff8c4d24c1b2a426670e38dd44f (diff) | |
download | gitlab-ce-e6226e8cb3d7e79500482ba2cef604133f667381.tar.gz |
Generalise test compare service
It adds a base class for CompareTestReportsService
containing common code with CompareLicenseManagementReportsService
which is present in GitLab Enterprise Edition.
Diffstat (limited to 'lib/gitlab/ci/parsers')
-rw-r--r-- | lib/gitlab/ci/parsers/parser_error.rb | 9 | ||||
-rw-r--r-- | lib/gitlab/ci/parsers/test.rb | 21 | ||||
-rw-r--r-- | lib/gitlab/ci/parsers/test/junit.rb | 2 |
3 files changed, 10 insertions, 22 deletions
diff --git a/lib/gitlab/ci/parsers/parser_error.rb b/lib/gitlab/ci/parsers/parser_error.rb new file mode 100644 index 00000000000..ef327737cdb --- /dev/null +++ b/lib/gitlab/ci/parsers/parser_error.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +module Gitlab + module Ci + module Parsers + ParserError = Class.new(StandardError) + end + end +end diff --git a/lib/gitlab/ci/parsers/test.rb b/lib/gitlab/ci/parsers/test.rb deleted file mode 100644 index c6bc9662b07..00000000000 --- a/lib/gitlab/ci/parsers/test.rb +++ /dev/null @@ -1,21 +0,0 @@ -# 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 diff --git a/lib/gitlab/ci/parsers/test/junit.rb b/lib/gitlab/ci/parsers/test/junit.rb index 2791730fd26..dca60eabc1c 100644 --- a/lib/gitlab/ci/parsers/test/junit.rb +++ b/lib/gitlab/ci/parsers/test/junit.rb @@ -5,7 +5,7 @@ module Gitlab module Parsers module Test class Junit - JunitParserError = Class.new(StandardError) + JunitParserError = Class.new(Gitlab::Ci::Parsers::ParserError) def parse!(xml_data, test_suite) root = Hash.from_xml(xml_data) |