summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKamil TrzciƄski <ayufan@ayufan.eu>2017-04-12 12:23:51 +0000
committerLin Jen-Shin <godfat@godfat.org>2017-04-13 19:49:58 +0800
commitac2bd99c8f998c865afc576381132e7bae725a54 (patch)
tree70b286d101391c41ef8ee4b9ea095211ce0e4ded /lib
parent58e53a012fbe317829be29dc856741d0d4550145 (diff)
downloadgitlab-ce-ac2bd99c8f998c865afc576381132e7bae725a54.tar.gz
Merge branch 'zj-fix-coverage-bug' into 'master'
Return nil as coverage instead of a File object See merge request !10633
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/ci/trace/stream.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/gitlab/ci/trace/stream.rb b/lib/gitlab/ci/trace/stream.rb
index 2af94e2c60e..41dcf846fed 100644
--- a/lib/gitlab/ci/trace/stream.rb
+++ b/lib/gitlab/ci/trace/stream.rb
@@ -76,11 +76,14 @@ module Gitlab
stream.each_line do |line|
matches = line.scan(regex)
next unless matches.is_a?(Array)
+ next if matches.empty?
match = matches.flatten.last
coverage = match.gsub(/\d+(\.\d+)?/).first
- return coverage.to_f if coverage.present?
+ return coverage if coverage.present?
end
+
+ nil
rescue
# if bad regex or something goes wrong we dont want to interrupt transition
# so we just silentrly ignore error for now