summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-07-04 14:58:51 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-07-21 12:45:35 +0200
commita9f6679ac1fc90d808a3db363e6c3af2ebeac6a1 (patch)
treeb78809ea90fb11a10491896ce1f8c6d032a999a5
parent63ceb31f8b15b4ba7fd1b4c971367a5e20aca311 (diff)
downloadgitlab-ce-a9f6679ac1fc90d808a3db363e6c3af2ebeac6a1.tar.gz
Use simplecov 0.12.0 which fixes merging test results
-rw-r--r--Gemfile2
-rwxr-xr-xscripts/merge-simplecov33
2 files changed, 2 insertions, 33 deletions
diff --git a/Gemfile b/Gemfile
index ead64a6d4df..35dd69ef408 100644
--- a/Gemfile
+++ b/Gemfile
@@ -302,7 +302,7 @@ group :development, :test do
gem 'rubocop', '~> 0.41.2', require: false
gem 'rubocop-rspec', '~> 1.5.0', require: false
gem 'scss_lint', '~> 0.47.0', require: false
- gem 'simplecov', '~> 0.11.0', require: false
+ gem 'simplecov', '~> 0.12.0', require: false
gem 'flog', '~> 4.3.2', require: false
gem 'flay', '~> 2.6.1', require: false
gem 'bundler-audit', '~> 0.5.0', require: false
diff --git a/scripts/merge-simplecov b/scripts/merge-simplecov
index 2af5f8c0918..9504321e6d7 100755
--- a/scripts/merge-simplecov
+++ b/scripts/merge-simplecov
@@ -46,42 +46,11 @@ def all_results
results
end
-def merge_resultset(a1, a2)
- return a1 || [] unless a2
- return a2 || [] unless a1
-
- new_array = a1.dup
- a2.each_with_index do |element, i|
- if element.nil? && new_array[i].nil?
- new_array[i] = nil
- elsif element.nil? && new_array[i] == 0 || element == 0 && new_array[i].nil?
- new_array[i] = nil
- else
- local_value = element || 0
- other_value = new_array[i] || 0
- new_array[i] = local_value + other_value
- end
- end
- new_array
-end
-
-def merge_hashes(h1, h2)
- new_resultset = {}
- (h1.keys + h2.keys).each do |filename|
- new_resultset[filename] = []
- end
-
- new_resultset.each_key do |filename|
- new_resultset[filename] = merge_resultset(h1[filename], h2[filename])
- end
- new_resultset
-end
-
def merged_result
merged = {}
results = all_results
results.each do |result|
- merged = merge_hashes(result.original_result, merged)
+ merged = result.original_result.merge_resultset(merged)
end
result = SimpleCov::Result.new(merged)
# Specify the command name