paraduct 1.0.0.beta6 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.hound.yml +3 -0
- data/.onkcop.yml +223 -0
- data/.rubocop.yml +10 -0
- data/CHANGELOG.md +6 -2
- data/Gemfile +1 -1
- data/README.md +2 -2
- data/Rakefile +1 -1
- data/bin/paraduct +1 -1
- data/lib/paraduct.rb +10 -10
- data/lib/paraduct/cli.rb +2 -2
- data/lib/paraduct/colored_label_logger.rb +1 -1
- data/lib/paraduct/configuration.rb +3 -3
- data/lib/paraduct/parallel_runner.rb +3 -3
- data/lib/paraduct/runner.rb +25 -25
- data/lib/paraduct/test_response.rb +4 -4
- data/lib/paraduct/variable_converter.rb +2 -3
- data/lib/paraduct/version.rb +1 -1
- data/paraduct.gemspec +5 -4
- data/spec/paraduct/cli_spec.rb +11 -11
- data/spec/paraduct/configuration_spec.rb +4 -4
- data/spec/paraduct/parallel_runner_spec.rb +40 -40
- data/spec/paraduct/runner_spec.rb +18 -15
- data/spec/paraduct/sync_utils_spec.rb +5 -5
- data/spec/paraduct/test_response_spec.rb +7 -7
- data/spec/paraduct/variable_converter_spec.rb +25 -26
- data/spec/paraduct_spec.rb +1 -1
- data/spec/spec_helper.rb +57 -59
- data/spec/support/contexts/stub_configuration.rb +2 -2
- data/spec/support/contexts/within_temp_work_dir.rb +0 -1
- metadata +21 -4
@@ -1,8 +1,8 @@
|
|
1
1
|
describe Paraduct::TestResponse do
|
2
|
-
let(:test_response){ Paraduct::TestResponse.new }
|
2
|
+
let(:test_response) { Paraduct::TestResponse.new }
|
3
3
|
|
4
4
|
describe "#successful?" do
|
5
|
-
subject{ test_response.successful? }
|
5
|
+
subject { test_response.successful? }
|
6
6
|
|
7
7
|
context "not include failure" do
|
8
8
|
before do
|
@@ -24,12 +24,12 @@ describe Paraduct::TestResponse do
|
|
24
24
|
end
|
25
25
|
|
26
26
|
describe "#detail_message" do
|
27
|
-
subject{ test_response.detail_message }
|
27
|
+
subject { test_response.detail_message }
|
28
28
|
|
29
29
|
context "when successful" do
|
30
30
|
before do
|
31
|
-
test_response.jobs_push(successful: true, params: { "ruby" => "1.8", "database" => "sqlite3" }
|
32
|
-
test_response.jobs_push(successful: true, params: { "ruby" => "1.9", "database" => "mysql" }
|
31
|
+
test_response.jobs_push(successful: true, params: { "ruby" => "1.8", "database" => "sqlite3" }, formatted_params: "ruby=1.8, database=sqlite3")
|
32
|
+
test_response.jobs_push(successful: true, params: { "ruby" => "1.9", "database" => "mysql" }, formatted_params: "ruby=1.9, database=mysql")
|
33
33
|
test_response.jobs_push(successful: true, params: { "ruby" => "2.0", "database" => "postgresql" }, formatted_params: "ruby=2.0, database=postgresql")
|
34
34
|
end
|
35
35
|
|
@@ -49,8 +49,8 @@ Passed:
|
|
49
49
|
|
50
50
|
context "when failure" do
|
51
51
|
before do
|
52
|
-
test_response.jobs_push(successful: true
|
53
|
-
test_response.jobs_push(successful: false, params: { "ruby" => "1.9", "database" => "mysql" }
|
52
|
+
test_response.jobs_push(successful: true, params: { "ruby" => "1.8", "database" => "sqlite3" }, formatted_params: "ruby=1.8, database=sqlite3")
|
53
|
+
test_response.jobs_push(successful: false, params: { "ruby" => "1.9", "database" => "mysql" }, formatted_params: "ruby=1.9, database=mysql")
|
54
54
|
test_response.jobs_push(successful: false, params: { "ruby" => "2.0", "database" => "postgresql" }, formatted_params: "ruby=2.0, database=postgresql")
|
55
55
|
end
|
56
56
|
|
@@ -42,30 +42,29 @@ describe Paraduct::VariableConverter do
|
|
42
42
|
end
|
43
43
|
|
44
44
|
it { should have(12).entries }
|
45
|
-
it { should include("ruby" => "1.9", "database" => "mysql"
|
46
|
-
it { should include("ruby" => "2.0", "database" => "mysql"
|
47
|
-
it { should include("ruby" => "2.1", "database" => "mysql"
|
45
|
+
it { should include("ruby" => "1.9", "database" => "mysql", "rails" => "3.2") }
|
46
|
+
it { should include("ruby" => "2.0", "database" => "mysql", "rails" => "3.2") }
|
47
|
+
it { should include("ruby" => "2.1", "database" => "mysql", "rails" => "3.2") }
|
48
48
|
it { should include("ruby" => "1.9", "database" => "postgresql", "rails" => "3.2") }
|
49
49
|
it { should include("ruby" => "2.0", "database" => "postgresql", "rails" => "3.2") }
|
50
50
|
it { should include("ruby" => "2.1", "database" => "postgresql", "rails" => "3.2") }
|
51
|
-
it { should include("ruby" => "1.9", "database" => "mysql"
|
52
|
-
it { should include("ruby" => "2.0", "database" => "mysql"
|
53
|
-
it { should include("ruby" => "2.1", "database" => "mysql"
|
51
|
+
it { should include("ruby" => "1.9", "database" => "mysql", "rails" => "4.0") }
|
52
|
+
it { should include("ruby" => "2.0", "database" => "mysql", "rails" => "4.0") }
|
53
|
+
it { should include("ruby" => "2.1", "database" => "mysql", "rails" => "4.0") }
|
54
54
|
it { should include("ruby" => "1.9", "database" => "postgresql", "rails" => "4.0") }
|
55
55
|
it { should include("ruby" => "2.0", "database" => "postgresql", "rails" => "4.0") }
|
56
56
|
it { should include("ruby" => "2.1", "database" => "postgresql", "rails" => "4.0") }
|
57
57
|
end
|
58
|
-
|
59
58
|
end
|
60
59
|
|
61
60
|
describe "#reject" do
|
62
|
-
subject{ Paraduct::VariableConverter.reject(product_variables, exclude_variables) }
|
61
|
+
subject { Paraduct::VariableConverter.reject(product_variables, exclude_variables) }
|
63
62
|
|
64
63
|
let(:product_variables) do
|
65
64
|
[
|
66
|
-
{ "ruby" => "1.9", "database" => "mysql"
|
67
|
-
{ "ruby" => "2.0", "database" => "mysql"
|
68
|
-
{ "ruby" => "2.1", "database" => "mysql"
|
65
|
+
{ "ruby" => "1.9", "database" => "mysql", "rails" => "3.2" },
|
66
|
+
{ "ruby" => "2.0", "database" => "mysql", "rails" => "3.2" },
|
67
|
+
{ "ruby" => "2.1", "database" => "mysql", "rails" => "3.2" },
|
69
68
|
]
|
70
69
|
end
|
71
70
|
|
@@ -78,9 +77,9 @@ describe Paraduct::VariableConverter do
|
|
78
77
|
|
79
78
|
it do
|
80
79
|
should contain_exactly(
|
81
|
-
|
82
|
-
|
83
|
-
|
80
|
+
{ "ruby" => "1.9", "database" => "mysql", "rails" => "3.2" },
|
81
|
+
{ "ruby" => "2.1", "database" => "mysql", "rails" => "3.2" }
|
82
|
+
)
|
84
83
|
end
|
85
84
|
end
|
86
85
|
|
@@ -93,42 +92,42 @@ describe Paraduct::VariableConverter do
|
|
93
92
|
|
94
93
|
it do
|
95
94
|
should contain_exactly(
|
96
|
-
|
97
|
-
|
98
|
-
|
95
|
+
{ "ruby" => "2.0", "database" => "mysql", "rails" => "3.2" },
|
96
|
+
{ "ruby" => "2.1", "database" => "mysql", "rails" => "3.2" }
|
97
|
+
)
|
99
98
|
end
|
100
99
|
end
|
101
100
|
end
|
102
101
|
|
103
102
|
describe "#partial_match?" do
|
104
|
-
subject{ Paraduct::VariableConverter.partial_match?(parent_hash, child_hash) }
|
103
|
+
subject { Paraduct::VariableConverter.partial_match?(parent_hash, child_hash) }
|
105
104
|
|
106
105
|
context "with parent_hash == child_hash" do
|
107
|
-
let(:parent_hash){ { a: 1, b: 2, c: 3 } }
|
106
|
+
let(:parent_hash) { { a: 1, b: 2, c: 3 } }
|
108
107
|
let(:child_hash) { { a: 1, b: 2, c: 3 } }
|
109
108
|
|
110
|
-
it{ should be true }
|
109
|
+
it { should be true }
|
111
110
|
end
|
112
111
|
|
113
112
|
context "with parent_hash > child_hash" do
|
114
|
-
let(:parent_hash){ { a: 1, b: 2, c: 3 } }
|
113
|
+
let(:parent_hash) { { a: 1, b: 2, c: 3 } }
|
115
114
|
let(:child_hash) { { a: 1, c: 3 } }
|
116
115
|
|
117
|
-
it{ should be true }
|
116
|
+
it { should be true }
|
118
117
|
end
|
119
118
|
|
120
119
|
context "with parent_hash > child_hash, but value is not same" do
|
121
|
-
let(:parent_hash){ { a: 1, b: 2, c: 3 } }
|
120
|
+
let(:parent_hash) { { a: 1, b: 2, c: 3 } }
|
122
121
|
let(:child_hash) { { a: 1, c: 4 } }
|
123
122
|
|
124
|
-
it{ should be false }
|
123
|
+
it { should be false }
|
125
124
|
end
|
126
125
|
|
127
126
|
context "with parent_hash < child_hash" do
|
128
|
-
let(:parent_hash){ { a: 1, b: 2, c: 3 } }
|
127
|
+
let(:parent_hash) { { a: 1, b: 2, c: 3 } }
|
129
128
|
let(:child_hash) { { a: 1, c: 3, d: 4 } }
|
130
129
|
|
131
|
-
it{ should be false }
|
130
|
+
it { should be false }
|
132
131
|
end
|
133
132
|
end
|
134
133
|
end
|
data/spec/paraduct_spec.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
if ENV["COVERAGE"]
|
2
|
-
require
|
3
|
-
require
|
4
|
-
require
|
2
|
+
require "simplecov"
|
3
|
+
require "coveralls"
|
4
|
+
require "codeclimate-test-reporter"
|
5
5
|
|
6
6
|
SimpleCov.formatter =
|
7
7
|
SimpleCov::Formatter::MultiFormatter.new([
|
8
8
|
CodeClimate::TestReporter::Formatter,
|
9
|
-
Coveralls::SimpleCov::Formatter
|
9
|
+
Coveralls::SimpleCov::Formatter,
|
10
10
|
])
|
11
11
|
SimpleCov.start do
|
12
12
|
%w(/bin/ /vendor/ /spec/).each do |ignore_path|
|
@@ -15,13 +15,13 @@ if ENV["COVERAGE"]
|
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
|
-
$LOAD_PATH.unshift File.expand_path(
|
19
|
-
require
|
20
|
-
require
|
21
|
-
require
|
22
|
-
require
|
23
|
-
require
|
24
|
-
require
|
18
|
+
$LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
|
19
|
+
require "paraduct"
|
20
|
+
require "paraduct/cli"
|
21
|
+
require "rspec/collection_matchers"
|
22
|
+
require "rspec/temp_dir"
|
23
|
+
require "rspec/its"
|
24
|
+
require "pry"
|
25
25
|
|
26
26
|
is_verbose = ENV["VERBOSE"].present?
|
27
27
|
|
@@ -71,54 +71,52 @@ RSpec.configure do |config|
|
|
71
71
|
mocks.verify_partial_doubles = true
|
72
72
|
end
|
73
73
|
|
74
|
-
# The settings below are suggested to provide a good initial experience
|
75
|
-
# with RSpec, but feel free to customize to your heart's content.
|
76
|
-
|
77
|
-
#
|
78
|
-
#
|
79
|
-
#
|
80
|
-
#
|
81
|
-
config.
|
82
|
-
|
83
|
-
|
84
|
-
#
|
85
|
-
#
|
86
|
-
# - http://
|
87
|
-
# - http://
|
88
|
-
#
|
89
|
-
|
90
|
-
|
91
|
-
#
|
92
|
-
#
|
93
|
-
|
94
|
-
|
95
|
-
#
|
96
|
-
#
|
97
|
-
#
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
#
|
106
|
-
#
|
107
|
-
#
|
108
|
-
|
109
|
-
|
110
|
-
#
|
111
|
-
#
|
112
|
-
#
|
113
|
-
#
|
114
|
-
|
115
|
-
|
116
|
-
#
|
117
|
-
#
|
118
|
-
#
|
119
|
-
#
|
120
|
-
Kernel.srand config.seed
|
121
|
-
=end
|
74
|
+
# The settings below are suggested to provide a good initial experience
|
75
|
+
# with RSpec, but feel free to customize to your heart's content.
|
76
|
+
# # These two settings work together to allow you to limit a spec run
|
77
|
+
# # to individual examples or groups you care about by tagging them with
|
78
|
+
# # `:focus` metadata. When nothing is tagged with `:focus`, all examples
|
79
|
+
# # get run.
|
80
|
+
# config.filter_run :focus
|
81
|
+
# config.run_all_when_everything_filtered = true
|
82
|
+
#
|
83
|
+
# # Limits the available syntax to the non-monkey patched syntax that is recommended.
|
84
|
+
# # For more details, see:
|
85
|
+
# # - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
|
86
|
+
# # - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
87
|
+
# # - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
|
88
|
+
# config.disable_monkey_patching!
|
89
|
+
#
|
90
|
+
# # This setting enables warnings. It's recommended, but in some cases may
|
91
|
+
# # be too noisy due to issues in dependencies.
|
92
|
+
# config.warnings = true
|
93
|
+
#
|
94
|
+
# # Many RSpec users commonly either run the entire suite or an individual
|
95
|
+
# # file, and it's useful to allow more verbose output when running an
|
96
|
+
# # individual spec file.
|
97
|
+
# if config.files_to_run.one?
|
98
|
+
# # Use the documentation formatter for detailed output,
|
99
|
+
# # unless a formatter has already been configured
|
100
|
+
# # (e.g. via a command-line flag).
|
101
|
+
# config.default_formatter = 'doc'
|
102
|
+
# end
|
103
|
+
#
|
104
|
+
# # Print the 10 slowest examples and example groups at the
|
105
|
+
# # end of the spec run, to help surface which specs are running
|
106
|
+
# # particularly slow.
|
107
|
+
# config.profile_examples = 10
|
108
|
+
#
|
109
|
+
# # Run specs in random order to surface order dependencies. If you find an
|
110
|
+
# # order dependency and want to debug it, you can fix the order by providing
|
111
|
+
# # the seed, which is printed after each run.
|
112
|
+
# # --seed 1234
|
113
|
+
# config.order = :random
|
114
|
+
#
|
115
|
+
# # Seed global randomization in this process using the `--seed` CLI option.
|
116
|
+
# # Setting this allows you to use `--seed` to deterministically reproduce
|
117
|
+
# # test failures related to randomization by passing the same `--seed` value
|
118
|
+
# # as the one that triggered the failure.
|
119
|
+
# Kernel.srand config.seed
|
122
120
|
|
123
121
|
config.order = :random
|
124
122
|
|
@@ -1,11 +1,11 @@
|
|
1
1
|
shared_context :stub_configuration do
|
2
2
|
before do
|
3
|
-
allow_any_instance_of(Paraduct::Configuration).to receive(:config_data){ config_data.stringify_keys.with_indifferent_access }
|
3
|
+
allow_any_instance_of(Paraduct::Configuration).to receive(:config_data) { config_data.stringify_keys.with_indifferent_access }
|
4
4
|
end
|
5
5
|
|
6
6
|
let(:config_data) do
|
7
7
|
{
|
8
|
-
script:
|
8
|
+
script: 'echo "NAME1=${NAME1}, NAME2=${NAME2}"',
|
9
9
|
work_dir: "tmp/paraduct_workspace",
|
10
10
|
variables: {
|
11
11
|
"NAME1" => ["value1a", "value1b"],
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paraduct
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sue445
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -122,6 +122,20 @@ dependencies:
|
|
122
122
|
- - ">="
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: rubocop
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - '='
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: 0.37.0
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - '='
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: 0.37.0
|
125
139
|
- !ruby/object:Gem::Dependency
|
126
140
|
name: pry-byebug
|
127
141
|
requirement: !ruby/object:Gem::Requirement
|
@@ -244,7 +258,10 @@ extra_rdoc_files: []
|
|
244
258
|
files:
|
245
259
|
- ".coveralls.yml"
|
246
260
|
- ".gitignore"
|
261
|
+
- ".hound.yml"
|
262
|
+
- ".onkcop.yml"
|
247
263
|
- ".rspec"
|
264
|
+
- ".rubocop.yml"
|
248
265
|
- ".tachikoma.yml"
|
249
266
|
- ".travis.yml"
|
250
267
|
- ".yardopts"
|
@@ -305,9 +322,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
305
322
|
version: 2.0.0
|
306
323
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
307
324
|
requirements:
|
308
|
-
- - "
|
325
|
+
- - ">="
|
309
326
|
- !ruby/object:Gem::Version
|
310
|
-
version:
|
327
|
+
version: '0'
|
311
328
|
requirements: []
|
312
329
|
rubyforge_project:
|
313
330
|
rubygems_version: 2.5.1
|