knapsack 1.17.2 → 1.18.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 +8 -0
- data/lib/knapsack/config/env.rb +6 -2
- data/lib/knapsack/version.rb +1 -1
- data/spec/knapsack/config/env_spec.rb +10 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b673e54c4a69c274d1c0bea7d3ab53d603ad95d178550a6d787904803dcc728f
|
4
|
+
data.tar.gz: b88dd14ffeb3dc33648ae953fc789d63cbc25a4be72d643dea6acddc09bc3f3e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2837e7b8732843c8b778c82c26c57c2f5757c6402c464a6e57f71c046c8c07f1674d9ae124ec6759808d81d557684cc62f7a5c1dda331a9265b1ebfc53cc8228
|
7
|
+
data.tar.gz: 9270341918460fb18dad56753b6cba0308783940c601b6cbd88331629c3f4453fd3e15faa355a8830822cdd98b449e8b96c1f7a58015cff385ca78f0108a8fd4
|
data/CHANGELOG.md
CHANGED
data/lib/knapsack/config/env.rb
CHANGED
@@ -7,11 +7,11 @@ module Knapsack
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def ci_node_total
|
10
|
-
ENV['CI_NODE_TOTAL'] || ENV['CIRCLE_NODE_TOTAL'] || ENV['SEMAPHORE_THREAD_COUNT'] || ENV['BUILDKITE_PARALLEL_JOB_COUNT'] || ENV['SNAP_WORKER_TOTAL'] || 1
|
10
|
+
ENV['CI_NODE_TOTAL'] || ENV['CIRCLE_NODE_TOTAL'] || ENV['SEMAPHORE_JOB_COUNT'] || ENV['SEMAPHORE_THREAD_COUNT'] || ENV['BUILDKITE_PARALLEL_JOB_COUNT'] || ENV['SNAP_WORKER_TOTAL'] || 1
|
11
11
|
end
|
12
12
|
|
13
13
|
def ci_node_index
|
14
|
-
gitlab_ci_node_index || ENV['CI_NODE_INDEX'] || ENV['CIRCLE_NODE_INDEX'] || semaphore_current_thread || ENV['BUILDKITE_PARALLEL_JOB'] || snap_ci_worker_index || 0
|
14
|
+
gitlab_ci_node_index || ENV['CI_NODE_INDEX'] || ENV['CIRCLE_NODE_INDEX'] || semaphore_job_index || semaphore_current_thread || ENV['BUILDKITE_PARALLEL_JOB'] || snap_ci_worker_index || 0
|
15
15
|
end
|
16
16
|
|
17
17
|
def test_file_pattern
|
@@ -36,6 +36,10 @@ module Knapsack
|
|
36
36
|
index.to_i - 1 if index
|
37
37
|
end
|
38
38
|
|
39
|
+
def semaphore_job_index
|
40
|
+
index_starting_from_one(ENV['SEMAPHORE_JOB_INDEX'])
|
41
|
+
end
|
42
|
+
|
39
43
|
def semaphore_current_thread
|
40
44
|
index_starting_from_one(ENV['SEMAPHORE_CURRENT_THREAD'])
|
41
45
|
end
|
data/lib/knapsack/version.rb
CHANGED
@@ -27,6 +27,11 @@ describe Knapsack::Config::Env do
|
|
27
27
|
it { should eql 4 }
|
28
28
|
end
|
29
29
|
|
30
|
+
context 'when SEMAPHORE_JOB_COUNT has value' do
|
31
|
+
before { stub_const("ENV", { 'SEMAPHORE_JOB_COUNT' => 3 }) }
|
32
|
+
it { should eql 3 }
|
33
|
+
end
|
34
|
+
|
30
35
|
context 'when SEMAPHORE_THREAD_COUNT has value' do
|
31
36
|
before { stub_const("ENV", { 'SEMAPHORE_THREAD_COUNT' => 3 }) }
|
32
37
|
it { should eql 3 }
|
@@ -67,6 +72,11 @@ describe Knapsack::Config::Env do
|
|
67
72
|
it { should eql 2 }
|
68
73
|
end
|
69
74
|
|
75
|
+
context 'when SEMAPHORE_JOB_INDEX has value' do
|
76
|
+
before { stub_const("ENV", { 'SEMAPHORE_JOB_INDEX' => 3 }) }
|
77
|
+
it { should eql 2 }
|
78
|
+
end
|
79
|
+
|
70
80
|
context 'when SEMAPHORE_CURRENT_THREAD has value' do
|
71
81
|
before { stub_const("ENV", { 'SEMAPHORE_CURRENT_THREAD' => 1 }) }
|
72
82
|
it { should eql 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.
|
4
|
+
version: 1.18.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ArturT
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-08-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|