summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2018-07-17 16:35:06 +0900
committerShinya Maeda <shinya@gitlab.com>2018-07-17 16:35:06 +0900
commitd0ad35fcc4b1d9c58d798775e13623026900ed27 (patch)
tree64c7b294297bb598856724d7fc6e91283d97f769
parent541292c37e5ad24f4d137454743808cfc1f3c216 (diff)
downloadgitlab-ce-d0ad35fcc4b1d9c58d798775e13623026900ed27.tar.gz
Remove unnecessary files
-rw-r--r--lib/gitlab/ci/build/artifacts/junit.rb36
-rw-r--r--lib/gitlab/ci/build/artifacts/xml.rb49
2 files changed, 0 insertions, 85 deletions
diff --git a/lib/gitlab/ci/build/artifacts/junit.rb b/lib/gitlab/ci/build/artifacts/junit.rb
deleted file mode 100644
index da3b8cea0ee..00000000000
--- a/lib/gitlab/ci/build/artifacts/junit.rb
+++ /dev/null
@@ -1,36 +0,0 @@
-module Gitlab
- module Ci
- module Build
- module Artifacts
- class Junit < XML
- attr_reader :junit_artifact
-
- def to_hash
- Gitlab::Ci::Build::Artifacts::XML.new(stream).each_hash do |file_name, hash|
- hash['testsuite'].each do |testsuite|
- # testsuite.name
- # testsuite.tests
- # testsuite.skipped
- # testsuite.failures
- testsuite['testcase'].each do |testcase|
- # testcase.classname
- # testcase.name
- # testcase.file
- # testcase.time
- if testcase.key?('failure')
- testcase['failure'] # stack_trace
- testcase['system-out']
- elsif testcase.key?('skipped') || testcase.key?('skipped')
- # TODO:
- else
- # passed
- end
- end
- end
- end
- end
- end
- end
- end
- end
-end
diff --git a/lib/gitlab/ci/build/artifacts/xml.rb b/lib/gitlab/ci/build/artifacts/xml.rb
deleted file mode 100644
index 5d3a0c62d6f..00000000000
--- a/lib/gitlab/ci/build/artifacts/xml.rb
+++ /dev/null
@@ -1,49 +0,0 @@
-require 'zlib'
-require 'json'
-
-module Gitlab
- module Ci
- module Build
- module Artifacts
- class XML
- attr_reader :stream
-
- def initialize(stream)
- @stream = stream
- end
-
- def each_hash
- each_raw do |file_name, xml|
- yield file_name, Hash.from_xml(xml)
- end
- rescue => e
- raise "Failed to parse xml #{e.message}"
- end
-
- def each_raw
- stream.seek(0)
-
- until stream.eof?
- gzip(stream) do |gz|
- yield gz.orig_name, gz.read
- unused = gz.unused&.length.to_i
- stream.seek(-unused, IO::SEEK_CUR) # IO has already reached EOF, so rewind the pos to the unsued file
- end
- end
- end
-
- def gzip(stream, &block)
- raise Metadata::InvalidStreamError, "Invalid stream" unless stream
-
- gz = Zlib::GzipReader.new(stream)
- yield(gz)
- rescue Zlib::Error => e
- raise Metadata::InvalidStreamError, e.message
- ensure
- gz&.finish
- end
- end
- end
- end
- end
-end