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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c61f6516fa6a095392a8ba944e43261cd7c566ea26242465d2f42b3d7ed253fc
4
- data.tar.gz: 30b50a3b66085ce2c0b1672b7fd815dec2a2b449f54625b65ca49da705411754
3
+ metadata.gz: b673e54c4a69c274d1c0bea7d3ab53d603ad95d178550a6d787904803dcc728f
4
+ data.tar.gz: b88dd14ffeb3dc33648ae953fc789d63cbc25a4be72d643dea6acddc09bc3f3e
5
5
  SHA512:
6
- metadata.gz: c2d01955882b05683b6c06482a186afe479fc1437a7c2a40bee66fb4353eda4cc0e10aaacafb8a860be1c7b693d4ee157de10fc8ceec553cee853e1e8f5318fd
7
- data.tar.gz: f4d4772ef21c7c05a3cf3f5a11d6e633cd2c163bb82eda5f79031c17c672ca4f61b8b4d8ca8c27906f0d467141dffe9590180d46697b344f298104cf445af673
6
+ metadata.gz: 2837e7b8732843c8b778c82c26c57c2f5757c6402c464a6e57f71c046c8c07f1674d9ae124ec6759808d81d557684cc62f7a5c1dda331a9265b1ebfc53cc8228
7
+ data.tar.gz: 9270341918460fb18dad56753b6cba0308783940c601b6cbd88331629c3f4453fd3e15faa355a8830822cdd98b449e8b96c1f7a58015cff385ca78f0108a8fd4
@@ -2,6 +2,14 @@
2
2
 
3
3
  * TODO
4
4
 
5
+ ### 1.18.0
6
+
7
+ * Add support for Semaphore 2.0
8
+
9
+ https://github.com/ArturT/knapsack/pull/92
10
+
11
+ https://github.com/ArturT/knapsack/compare/v1.17.2...v1.18.0
12
+
5
13
  ### 1.17.2
6
14
 
7
15
  * Allow for new `bundler` in development
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Knapsack
2
- VERSION = '1.17.2'
2
+ VERSION = '1.18.0'
3
3
  end
@@ -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.17.2
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-07-02 00:00:00.000000000 Z
11
+ date: 2019-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake