knapsack_pro 0.55.2 → 0.56.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: 659ee8cc41fe02f9756a80b1df0611052ef20132cb64afc909d050c3c438e5f0
4
- data.tar.gz: 9c5f97c7a0606a936512542aea04d84aa21e23806215cdbba0445651eef354e2
3
+ metadata.gz: da5bcf0250bd8e08462d58cb9b6a8d3886c02b692bbcf88923637cdce814c865
4
+ data.tar.gz: f01be1f4ea567e182e7d6f82b53c8d7eb2cba66a682b80c8d6c85e2ec6d01228
5
5
  SHA512:
6
- metadata.gz: e48213d6111290298b56a7ada4621144279dc6b6e5e435e244c6a65a3f159b5e34297183803341b009a86c09acbe4827e8c9879a87e25f9a494fb5fb5af6d43d
7
- data.tar.gz: aef93bd34c521290ec5096754b4cd1b531a9e5da828d48237b78d635e1771c63604b4dad88b5808808059fac9da407cddb679e76f219c4359483a1558b6f53e0
6
+ metadata.gz: ebdf97614db4bcdd15ead1d751c3872234edeac12d234101c073cbbce86e71cb1ae311cff9cc1046d2371aed4aca0866da1a464e20a66ba317629634f822c80f
7
+ data.tar.gz: 4d9a8fdce9c06e73e55afa1cfd4ab41e33e29a17c0e44e8c9fd3ba7dc9d9d17ac6153a53250ca67d5fe839e2aa7eba724c36ab882b882d0146f4659bc8241e6b
@@ -2,6 +2,14 @@
2
2
 
3
3
  * TODO
4
4
 
5
+ ### 0.56.0
6
+
7
+ * Add support for Cirrus CI
8
+
9
+ https://github.com/KnapsackPro/knapsack_pro-ruby/pull/65
10
+
11
+ https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v0.55.2...v0.56.0
12
+
5
13
  ### 0.55.2
6
14
 
7
15
  * Remove recursion in Queue Mode
data/README.md CHANGED
@@ -106,6 +106,7 @@ The knapsack_pro has also [queue mode](#queue-mode) to get an optimal test suite
106
106
  - [Info for codeship.com users](#info-for-codeshipcom-users)
107
107
  - [Info for Heroku CI users](#info-for-heroku-ci-users)
108
108
  - [Info for snap-ci.com users](#info-for-snap-cicom-users)
109
+ - [Info for cirrus-ci.org users](#info-for-cirrus-ciorg-users)
109
110
  - [Info for Jenkins users](#info-for-jenkins-users)
110
111
  - [FAQ](#faq)
111
112
  - [Common problems](#common-problems)
@@ -996,6 +997,27 @@ Knapsack Pro supports snap-ci.com ENVs `SNAP_WORKER_TOTAL` and `SNAP_WORKER_INDE
996
997
 
997
998
  Please remember to set up token like `KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC` as global environment.
998
999
 
1000
+ #### Info for cirrus-ci.org users
1001
+
1002
+ Knapsack Pro supports cirrus-ci.org ENVs `CI_NODE_TOTAL` and `CI_NODE_INDEX`. The only thing you need to do is to configure number of parallel CI nodes for your project. Next thing is to set one of below commands to be executed on each parallel CI node:
1003
+
1004
+ # Step for RSpec
1005
+ bundle exec rake knapsack_pro:rspec
1006
+
1007
+ # Step for Cucumber
1008
+ bundle exec rake knapsack_pro:cucumber
1009
+
1010
+ # Step for Minitest
1011
+ bundle exec rake knapsack_pro:minitest
1012
+
1013
+ # Step for test-unit
1014
+ bundle exec rake knapsack_pro:test_unit
1015
+
1016
+ # Step for Spinach
1017
+ bundle exec rake knapsack_pro:spinach
1018
+
1019
+ Please remember to set up token like `KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC` as global environment.
1020
+
999
1021
  #### Info for Jenkins users
1000
1022
 
1001
1023
  In order to run parallel jobs with Jenkins you should use Jenkins Pipeline.
@@ -13,6 +13,7 @@ require_relative 'knapsack_pro/utils'
13
13
  require_relative 'knapsack_pro/logger_wrapper'
14
14
  require_relative 'knapsack_pro/config/ci/base'
15
15
  require_relative 'knapsack_pro/config/ci/circle'
16
+ require_relative 'knapsack_pro/config/ci/cirrus_ci'
16
17
  require_relative 'knapsack_pro/config/ci/gitlab_ci'
17
18
  require_relative 'knapsack_pro/config/ci/semaphore'
18
19
  require_relative 'knapsack_pro/config/ci/buildkite'
@@ -0,0 +1,31 @@
1
+ module KnapsackPro
2
+ module Config
3
+ module CI
4
+ class CirrusCI < Base
5
+ def node_total
6
+ ENV['CI_NODE_TOTAL']
7
+ end
8
+
9
+ def node_index
10
+ ENV['CI_NODE_INDEX']
11
+ end
12
+
13
+ def node_build_id
14
+ ENV['CIRRUS_BUILD_ID']
15
+ end
16
+
17
+ def commit_hash
18
+ ENV['CIRRUS_CHANGE_IN_REPO']
19
+ end
20
+
21
+ def branch
22
+ ENV['CIRRUS_BRANCH']
23
+ end
24
+
25
+ def project_dir
26
+ ENV['CIRRUS_WORKING_DIR']
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
@@ -1,3 +1,3 @@
1
1
  module KnapsackPro
2
- VERSION = '0.55.2'
2
+ VERSION = '0.56.0'
3
3
  end
@@ -0,0 +1,87 @@
1
+ describe KnapsackPro::Config::CI::CirrusCI do
2
+ let(:env) { {} }
3
+
4
+ before do
5
+ stub_const('ENV', env)
6
+ end
7
+
8
+ it { should be_kind_of KnapsackPro::Config::CI::Base }
9
+
10
+ describe '#node_total' do
11
+ subject { described_class.new.node_total }
12
+
13
+ context 'when environment exists' do
14
+ let(:env) { { 'CI_NODE_TOTAL' => 4 } }
15
+ it { should eql 4 }
16
+ end
17
+
18
+ context "when environment doesn't exist" do
19
+ it { should be nil }
20
+ end
21
+ end
22
+
23
+ describe '#node_index' do
24
+ subject { described_class.new.node_index }
25
+
26
+ context 'when environment exists' do
27
+ let(:env) { { 'CI_NODE_INDEX' => 3 } }
28
+ it { should eql 3 }
29
+ end
30
+
31
+ context "when environment doesn't exist" do
32
+ it { should be nil }
33
+ end
34
+ end
35
+
36
+ describe '#node_build_id' do
37
+ subject { described_class.new.node_build_id }
38
+
39
+ context 'when environment exists' do
40
+ let(:env) { { 'CIRRUS_BUILD_ID' => 123 } }
41
+ it { should eql 123 }
42
+ end
43
+
44
+ context "when environment doesn't exist" do
45
+ it { should be nil }
46
+ end
47
+ end
48
+
49
+ describe '#commit_hash' do
50
+ subject { described_class.new.commit_hash }
51
+
52
+ context 'when environment exists' do
53
+ let(:env) { { 'CIRRUS_CHANGE_IN_REPO' => '2e13512fc230d6f9ebf4923352718e4d' } }
54
+ it { should eql '2e13512fc230d6f9ebf4923352718e4d' }
55
+ end
56
+
57
+ context "when environment doesn't exist" do
58
+ it { should be nil }
59
+ end
60
+ end
61
+
62
+ describe '#branch' do
63
+ subject { described_class.new.branch }
64
+
65
+ context 'when environment exists' do
66
+ let(:env) { { 'CIRRUS_BRANCH' => 'master' } }
67
+ it { should eql 'master' }
68
+ end
69
+
70
+ context "when environment doesn't exist" do
71
+ it { should be nil }
72
+ end
73
+ end
74
+
75
+ describe '#project_dir' do
76
+ subject { described_class.new.project_dir }
77
+
78
+ context 'when environment exists' do
79
+ let(:env) { { 'CIRRUS_WORKING_DIR' => '/tmp/cirrus-ci-build' } }
80
+ it { should eql '/tmp/cirrus-ci-build' }
81
+ end
82
+
83
+ context "when environment doesn't exist" do
84
+ it { should be nil }
85
+ end
86
+ end
87
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knapsack_pro
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.55.2
4
+ version: 0.56.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ArturT
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-02 00:00:00.000000000 Z
11
+ date: 2018-08-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -236,6 +236,7 @@ files:
236
236
  - lib/knapsack_pro/config/ci/base.rb
237
237
  - lib/knapsack_pro/config/ci/buildkite.rb
238
238
  - lib/knapsack_pro/config/ci/circle.rb
239
+ - lib/knapsack_pro/config/ci/cirrus_ci.rb
239
240
  - lib/knapsack_pro/config/ci/codeship.rb
240
241
  - lib/knapsack_pro/config/ci/gitlab_ci.rb
241
242
  - lib/knapsack_pro/config/ci/heroku.rb
@@ -314,6 +315,7 @@ files:
314
315
  - spec/knapsack_pro/config/ci/base_spec.rb
315
316
  - spec/knapsack_pro/config/ci/buildkite_spec.rb
316
317
  - spec/knapsack_pro/config/ci/circle_spec.rb
318
+ - spec/knapsack_pro/config/ci/cirrus_ci_spec.rb
317
319
  - spec/knapsack_pro/config/ci/codeship_spec.rb
318
320
  - spec/knapsack_pro/config/ci/gitlab_ci_spec.rb
319
321
  - spec/knapsack_pro/config/ci/heroku_spec.rb
@@ -416,6 +418,7 @@ test_files:
416
418
  - spec/knapsack_pro/config/ci/base_spec.rb
417
419
  - spec/knapsack_pro/config/ci/buildkite_spec.rb
418
420
  - spec/knapsack_pro/config/ci/circle_spec.rb
421
+ - spec/knapsack_pro/config/ci/cirrus_ci_spec.rb
419
422
  - spec/knapsack_pro/config/ci/codeship_spec.rb
420
423
  - spec/knapsack_pro/config/ci/gitlab_ci_spec.rb
421
424
  - spec/knapsack_pro/config/ci/heroku_spec.rb