knapsack 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e248debc4bc1dd04e46fe1be7ed75a54d245b782
|
4
|
+
data.tar.gz: 084848b68ebf859224d460bc74684cbc4d3b5c98
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2acdbf01e8c49ac212a82013a8a6295b891d69b557960f40a0f5152bf0d5d7cfea06e748a7e318e54588f40c196b003c6f51208d3f79a032675075e2cc69cddb
|
7
|
+
data.tar.gz: 0048c16e8d0bcf0ee4d1333f25e8f346b95f76ea7eab9b182d7599c20943172fdd2e25123b3912284212df3031f128d853785e845809779760cc928e0ea3438d
|
data/CHANGELOG.md
CHANGED
@@ -8,6 +8,10 @@ module Knapsack
|
|
8
8
|
@test_file_pattern = args[:test_file_pattern] || raise('Missing test_file_pattern')
|
9
9
|
@ci_node_total = args[:ci_node_total] || raise('Missing ci_node_total')
|
10
10
|
@ci_node_index = args[:ci_node_index] || raise('Missing ci_node_index')
|
11
|
+
|
12
|
+
if ci_node_index >= ci_node_total
|
13
|
+
raise("Node indexes are 0-based. Can't be higher or equal to the total number of nodes.")
|
14
|
+
end
|
11
15
|
end
|
12
16
|
|
13
17
|
def ci_node_total
|
data/lib/knapsack/version.rb
CHANGED
@@ -49,6 +49,22 @@ describe Knapsack::Distributors::BaseDistributor do
|
|
49
49
|
let(:custom_args) { { ci_node_index: nil } }
|
50
50
|
it { expect { subject }.to raise_error('Missing ci_node_index') }
|
51
51
|
end
|
52
|
+
|
53
|
+
context 'when ci_node_index has not allowed value' do
|
54
|
+
let(:expected_exception_message) do
|
55
|
+
"Node indexes are 0-based. Can't be higher or equal to the total number of nodes."
|
56
|
+
end
|
57
|
+
|
58
|
+
context 'when ci_node_index is equal to ci_node_total' do
|
59
|
+
let(:custom_args) { { ci_node_index: 1, ci_node_total: 1 } }
|
60
|
+
it { expect { subject }.to raise_error(expected_exception_message) }
|
61
|
+
end
|
62
|
+
|
63
|
+
context 'when ci_node_index is higher than ci_node_total' do
|
64
|
+
let(:custom_args) { { ci_node_index: 2, ci_node_total: 1 } }
|
65
|
+
it { expect { subject }.to raise_error(expected_exception_message) }
|
66
|
+
end
|
67
|
+
end
|
52
68
|
end
|
53
69
|
|
54
70
|
describe '#tests_for_current_node' do
|
@@ -161,7 +161,7 @@ describe Knapsack::Tracker do
|
|
161
161
|
end
|
162
162
|
end
|
163
163
|
|
164
|
-
it { expect(tracker.global_time).to be
|
164
|
+
it { expect(tracker.global_time).to be > 0 }
|
165
165
|
it { expect(tracker.global_time).to be_within(delta).of(0) }
|
166
166
|
it { expect(tracker.test_files_with_time.keys.size).to eql 2 }
|
167
167
|
it { expect(tracker.test_files_with_time['a_spec.rb']).to be_within(delta).of(0) }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: knapsack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ArturT
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|