simplecov-parallel 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +1 -1
- data/Rakefile +2 -2
- data/lib/simplecov/parallel/adapter/circleci.rb +25 -22
- data/lib/simplecov/parallel/version.rb +1 -1
- data/simplecov-parallel.gemspec +2 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b1b18a919b8a7444c5deaa06423301665a42b75
|
4
|
+
data.tar.gz: 31c6e5df9833b1cdcec3fb45ffa80291c4691d75
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cdca8ec716208c9c2600af61d97e6d27321a43826443eb3d3b1fa6370e1fc9df17ec6124d85521b0009fa4ae9fd701cc2acea98db7db62d1597b3a0c8dd9faae
|
7
|
+
data.tar.gz: b3097f911b8977a062dfc460b66856110cee0b6a92a8fa4ede09b70e0303963b18def6bc868c13d38d9ddebf848e220b9f2c698c2b21210ac4e0ec0a6efee440
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
data/Rakefile
CHANGED
@@ -12,22 +12,35 @@ module SimpleCov
|
|
12
12
|
def activate
|
13
13
|
require 'circleci/parallel'
|
14
14
|
require 'fileutils'
|
15
|
+
configure_circleci_parallel
|
16
|
+
configure_simplecov
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
15
20
|
|
21
|
+
def configure_circleci_parallel
|
22
|
+
::CircleCI::Parallel.configure do |config|
|
23
|
+
config.on_each_slave_node.before_sync do
|
24
|
+
export_slave_node_result
|
25
|
+
end
|
26
|
+
|
27
|
+
config.on_master_node.after_download do
|
28
|
+
merge_slave_node_results
|
29
|
+
merge_master_node_result_and_format
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def configure_simplecov
|
16
35
|
SimpleCov.command_name("#{SimpleCov.command_name} #{current_node.name}")
|
17
36
|
|
18
37
|
SimpleCov.at_exit do
|
19
38
|
puts 'Merging SimpleCov result into the master node...'
|
20
|
-
|
21
|
-
join_nodes_and_merge_slave_node_results
|
22
|
-
merge_and_format_master_node_result
|
39
|
+
::CircleCI::Parallel.sync
|
23
40
|
end
|
24
41
|
end
|
25
42
|
|
26
|
-
private
|
27
|
-
|
28
43
|
def export_slave_node_result
|
29
|
-
return if current_node.master?
|
30
|
-
|
31
44
|
# Export result to coverage/.resultset.json
|
32
45
|
# https://github.com/colszowka/simplecov/blob/v0.12.0/lib/simplecov.rb#L89
|
33
46
|
raise 'SimpleCov.use_merging must be set to true' unless SimpleCov.use_merging
|
@@ -39,30 +52,20 @@ module SimpleCov
|
|
39
52
|
)
|
40
53
|
end
|
41
54
|
|
42
|
-
def
|
43
|
-
|
44
|
-
|
55
|
+
def merge_slave_node_results
|
56
|
+
Dir.glob('node*') do |node_dir|
|
57
|
+
results = load_results_from_dir(node_dir)
|
58
|
+
merge_and_save_results(results)
|
45
59
|
end
|
46
|
-
|
47
|
-
::CircleCI::Parallel.join
|
48
60
|
end
|
49
61
|
|
50
|
-
def
|
51
|
-
return unless current_node.master?
|
52
|
-
|
62
|
+
def merge_master_node_result_and_format
|
53
63
|
# Invoking `SimpleCov.result` here merges the master node data into the slave node data.
|
54
64
|
# `SimpleCov.result.format!` is the default behavior of at_exit:
|
55
65
|
# https://github.com/colszowka/simplecov/blob/v0.12.0/lib/simplecov/configuration.rb#L172
|
56
66
|
SimpleCov.result.format!
|
57
67
|
end
|
58
68
|
|
59
|
-
def merge_slave_node_results
|
60
|
-
Dir.glob('node*') do |node_dir|
|
61
|
-
results = load_results_from_dir(node_dir)
|
62
|
-
merge_and_save_results(results)
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
69
|
def load_results_from_dir(dir)
|
67
70
|
with_changing_resultset_path(dir) do
|
68
71
|
SimpleCov::ResultMerger.results
|
data/simplecov-parallel.gemspec
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# coding: utf-8
|
2
|
+
|
2
3
|
lib = File.expand_path('../lib', __FILE__)
|
3
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
5
|
require 'simplecov/parallel/version'
|
@@ -19,7 +20,7 @@ Gem::Specification.new do |spec|
|
|
19
20
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
21
|
spec.require_paths = ['lib']
|
21
22
|
|
22
|
-
spec.add_runtime_dependency 'circleci-parallel', '~> 0.
|
23
|
+
spec.add_runtime_dependency 'circleci-parallel', '~> 0.5'
|
23
24
|
# simplecov 0.12.0 has a bug in result merger.
|
24
25
|
# https://github.com/colszowka/simplecov/pull/513
|
25
26
|
spec.add_runtime_dependency 'simplecov', '~> 0.13'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simplecov-parallel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuji Nakayama
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-08-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: circleci-parallel
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0.
|
19
|
+
version: '0.5'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0.
|
26
|
+
version: '0.5'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: simplecov
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -115,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
115
115
|
version: '0'
|
116
116
|
requirements: []
|
117
117
|
rubyforge_project:
|
118
|
-
rubygems_version: 2.6.
|
118
|
+
rubygems_version: 2.6.11
|
119
119
|
signing_key:
|
120
120
|
specification_version: 4
|
121
121
|
summary: SimpleCov extension for parallelism support
|