knapsack_pro 3.8.0 → 3.10.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: 8c5d5612a2f5309c5b786c57f3b51388e0381bf71c7935282ebfb0f3d5bf3d77
4
- data.tar.gz: 94767bc5aee313347653df3658a3251dabb0897211dc7694cb148392cfe8e842
3
+ metadata.gz: 5a557f5e56b1700cf9391abc05a6ce45321dcc2a79812927d1c78dbecf00dd09
4
+ data.tar.gz: 908a4ac991778a85e3168fb5db8f06d77573a79e182cfed1e48b719037bf68dd
5
5
  SHA512:
6
- metadata.gz: c67e3c33a86d27dc8fc79c2a31dab1a6b76dac8ea43002760bbcac3284f3e57af2f28b4fd91c0ee7469fd7a4e7dc5c32279fc89fa14afac806df4e395a0032ae
7
- data.tar.gz: c8da5c7bf455a7705daf0e012d84aeac078e7c800b7a5013806b188d41052a86f30c44e50dfd2ddf23d025fb690e173d68d0b6dddee3ede0666cdda21cc4b090
6
+ metadata.gz: cbba79dc7e72bf2785654ab7cf82d39cfbd34ff44395dd378c24a77ad283c7c7e243f3daf84e99206f439a4535b539dd20cd183454682ba38719cd24e0da7a5b
7
+ data.tar.gz: e326a929107db8167d023b12c133edada0b849808f0b848e6eb235d5156f588e5bd6a347637fd7e689e844620717f178ca7c7dd395de000e19bc225f423d6666
data/.circleci/config.yml CHANGED
@@ -8,7 +8,8 @@ jobs:
8
8
  parallelism: 1
9
9
  docker:
10
10
  # specify the version you desire here
11
- - image: circleci/ruby:3.0.2
11
+ # https://circleci.com/developer/images/image/cimg/ruby
12
+ - image: cimg/ruby:3.2.1
12
13
  environment:
13
14
  CODECLIMATE_REPO_TOKEN: b6626e682a8e97e0c5978febc92c3526792a2d018b41b8e1b52689da37fb7d92
14
15
 
data/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Change Log
2
2
 
3
+ ### 3.10.0
4
+
5
+ * Remove Solano CI and Snap CI support because they do not exist anymore
6
+
7
+ https://github.com/KnapsackPro/knapsack_pro-ruby/pull/194
8
+
9
+ https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v3.9.0...v3.10.0
10
+
11
+ ### 3.9.0
12
+
13
+ * Suppress all RSpec spec file names displayed in stdout at the beginning of running tests in Regular Mode only when the log level is >= `warn`
14
+
15
+ https://github.com/KnapsackPro/knapsack_pro-ruby/pull/190
16
+
17
+ https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v3.8.0...v3.9.0
18
+
3
19
  ### 3.8.0
4
20
 
5
21
  * Extract URLs and point them at `https://knapsackpro.com/perma/ruby/*`
data/README.md CHANGED
@@ -51,10 +51,10 @@ The `knapsack_pro` gem supports all CIs and the following test runners:
51
51
 
52
52
  ## Installation
53
53
 
54
- The [Installation Guide](http://docs.knapsackpro.com/knapsack_pro-ruby/guide/?utm_source=github&utm_medium=readme&utm_campaign=knapsack_pro-ruby_gem&utm_content=installation_guide) will ask you a few questions and generate instruction steps for your project:
54
+ The [Installation Guide](https://docs.knapsackpro.com/knapsack_pro-ruby/guide/?utm_source=github&utm_medium=readme&utm_campaign=knapsack_pro-ruby_gem&utm_content=installation_guide) will ask you a few questions and generate instruction steps for your project:
55
55
 
56
56
  <div align="center">
57
- <a href="http://docs.knapsackpro.com/knapsack_pro-ruby/guide/?utm_source=github&utm_medium=readme&utm_campaign=knapsack_pro-ruby_gem&utm_content=installation_guide">
57
+ <a href="https://docs.knapsackpro.com/knapsack_pro-ruby/guide/?utm_source=github&utm_medium=readme&utm_campaign=knapsack_pro-ruby_gem&utm_content=installation_guide">
58
58
  <img alt="Install button" src="./.github/assets/install-button.png" width="116" height="50" />
59
59
  </a>
60
60
  </div>
@@ -32,6 +32,7 @@ module KnapsackPro
32
32
  # instead we pass test files and test example paths to t.rspec_opts
33
33
  t.pattern = []
34
34
  t.rspec_opts = "#{args} --default-path #{runner.test_dir} #{runner.stringify_test_file_paths}"
35
+ t.verbose = KnapsackPro::Config::Env.log_level < ::Logger::WARN
35
36
  end
36
37
  Rake::Task[task_name].invoke
37
38
  end
@@ -1,3 +1,3 @@
1
1
  module KnapsackPro
2
- VERSION = '3.8.0'
2
+ VERSION = '3.10.0'
3
3
  end
data/lib/knapsack_pro.rb CHANGED
@@ -21,8 +21,6 @@ require_relative 'knapsack_pro/config/ci/semaphore'
21
21
  require_relative 'knapsack_pro/config/ci/semaphore2'
22
22
  require_relative 'knapsack_pro/config/ci/buildkite'
23
23
  require_relative 'knapsack_pro/config/ci/travis'
24
- require_relative 'knapsack_pro/config/ci/snap_ci'
25
- require_relative 'knapsack_pro/config/ci/solano_ci'
26
24
  require_relative 'knapsack_pro/config/ci/codeship'
27
25
  require_relative 'knapsack_pro/config/ci/github_actions'
28
26
  require_relative 'knapsack_pro/config/ci/heroku'
@@ -98,6 +98,7 @@ describe KnapsackPro::Adapters::BaseAdapter do
98
98
 
99
99
  before do
100
100
  expect(::Kernel).to receive(:at_exit).and_yield
101
+ allow(File).to receive(:exist?)
101
102
  expect(File).to receive(:exist?).with('.knapsack_pro/KnapsackPro-Adapters-BaseAdapter-bind_method_called_for_node_0.txt').and_return(adapter_bind_method_called_file_exists)
102
103
  end
103
104
 
@@ -114,6 +114,7 @@ describe KnapsackPro::Runners::Queue::MinitestRunner do
114
114
  expect(tracker).to receive(:set_prerun_tests).with(test_file_paths)
115
115
 
116
116
  # .minitest_run
117
+ allow(File).to receive(:exist?)
117
118
  expect(File).to receive(:exist?).with('./a_test.rb').and_return(true)
118
119
  expect(File).to receive(:exist?).with('./b_test.rb').and_return(true)
119
120
  expect(File).to receive(:exist?).with('./fake_path_test.rb').and_return(false)
@@ -36,6 +36,7 @@ describe KnapsackPro::Runners::RSpecRunner do
36
36
  test_files_to_execute_exist?: true)
37
37
  end
38
38
  let(:task) { double }
39
+ let(:task_config) { double }
39
40
 
40
41
  before do
41
42
  expect(KnapsackPro::Adapters::RSpecAdapter).to receive(:verify_bind_method_called).ordered
@@ -47,36 +48,55 @@ describe KnapsackPro::Runners::RSpecRunner do
47
48
 
48
49
  expect(Rake::Task).to receive(:[]).with('knapsack_pro:rspec_run').at_least(1).and_return(task)
49
50
 
50
- t = double
51
- expect(RSpec::Core::RakeTask).to receive(:new).with('knapsack_pro:rspec_run').and_yield(t)
52
- expect(t).to receive(:rspec_opts=).with('--profile --color --default-path fake-test-dir spec/a_spec.rb spec/b_spec.rb[1:1]')
53
- expect(t).to receive(:pattern=).with([])
51
+ expect(RSpec::Core::RakeTask).to receive(:new).with('knapsack_pro:rspec_run').and_yield(task_config)
52
+ expect(task_config).to receive(:rspec_opts=).with('--profile --color --default-path fake-test-dir spec/a_spec.rb spec/b_spec.rb[1:1]')
53
+ expect(task_config).to receive(:pattern=).with([])
54
54
  end
55
55
 
56
- context 'when rake task already exists' do
57
- before do
58
- expect(Rake::Task).to receive(:task_defined?).with('knapsack_pro:rspec_run').and_return(true)
59
- expect(task).to receive(:clear)
56
+ shared_examples 'invokes RSpec rake task' do
57
+ context 'when rake task already exists' do
58
+ before do
59
+ expect(Rake::Task).to receive(:task_defined?).with('knapsack_pro:rspec_run').and_return(true)
60
+ expect(task).to receive(:clear)
61
+ end
62
+
63
+ it do
64
+ result = double(:result)
65
+ expect(task).to receive(:invoke).and_return(result)
66
+ expect(subject).to eq result
67
+ end
60
68
  end
61
69
 
62
- it do
63
- result = double(:result)
64
- expect(task).to receive(:invoke).and_return(result)
65
- expect(subject).to eq result
70
+ context "when rake task doesn't exist" do
71
+ before do
72
+ expect(Rake::Task).to receive(:task_defined?).with('knapsack_pro:rspec_run').and_return(false)
73
+ expect(task).not_to receive(:clear)
74
+ end
75
+
76
+ it do
77
+ result = double(:result)
78
+ expect(task).to receive(:invoke).and_return(result)
79
+ expect(subject).to eq result
80
+ end
66
81
  end
67
82
  end
68
83
 
69
- context "when rake task doesn't exist" do
84
+ context 'when the default log level' do
70
85
  before do
71
- expect(Rake::Task).to receive(:task_defined?).with('knapsack_pro:rspec_run').and_return(false)
72
- expect(task).not_to receive(:clear)
86
+ expect(task_config).to receive(:verbose=).with(true)
73
87
  end
74
88
 
75
- it do
76
- result = double(:result)
77
- expect(task).to receive(:invoke).and_return(result)
78
- expect(subject).to eq result
89
+ it_behaves_like 'invokes RSpec rake task'
90
+ end
91
+
92
+ context 'when the warning log level' do
93
+ before do
94
+ expect(KnapsackPro::Config::Env).to receive(:log_level).and_return(::Logger::WARN)
95
+
96
+ expect(task_config).to receive(:verbose=).with(false)
79
97
  end
98
+
99
+ it_behaves_like 'invokes RSpec rake task'
80
100
  end
81
101
  end
82
102
 
@@ -11,6 +11,7 @@ describe KnapsackPro::TestCaseDetectors::RSpecTestExampleDetector do
11
11
 
12
12
  expect(FileUtils).to receive(:mkdir_p).with(report_dir)
13
13
 
14
+ allow(File).to receive(:exist?)
14
15
  expect(File).to receive(:exist?).at_least(:once).with(report_path).and_return(true)
15
16
  expect(File).to receive(:delete).with(report_path)
16
17
 
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: 3.8.0
4
+ version: 3.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ArturT
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-02-28 00:00:00.000000000 Z
11
+ date: 2023-05-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -230,8 +230,6 @@ files:
230
230
  - lib/knapsack_pro/config/ci/heroku.rb
231
231
  - lib/knapsack_pro/config/ci/semaphore.rb
232
232
  - lib/knapsack_pro/config/ci/semaphore2.rb
233
- - lib/knapsack_pro/config/ci/snap_ci.rb
234
- - lib/knapsack_pro/config/ci/solano_ci.rb
235
233
  - lib/knapsack_pro/config/ci/travis.rb
236
234
  - lib/knapsack_pro/config/env.rb
237
235
  - lib/knapsack_pro/config/env_generator.rb
@@ -327,8 +325,6 @@ files:
327
325
  - spec/knapsack_pro/config/ci/heroku_spec.rb
328
326
  - spec/knapsack_pro/config/ci/semaphore2_spec.rb
329
327
  - spec/knapsack_pro/config/ci/semaphore_spec.rb
330
- - spec/knapsack_pro/config/ci/snap_ci_spec.rb
331
- - spec/knapsack_pro/config/ci/solano_ci_spec.rb
332
328
  - spec/knapsack_pro/config/ci/travis_spec.rb
333
329
  - spec/knapsack_pro/config/env_generator_spec.rb
334
330
  - spec/knapsack_pro/config/env_spec.rb
@@ -408,7 +404,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
408
404
  - !ruby/object:Gem::Version
409
405
  version: '0'
410
406
  requirements: []
411
- rubygems_version: 3.2.3
407
+ rubygems_version: 3.4.10
412
408
  signing_key:
413
409
  specification_version: 4
414
410
  summary: Knapsack Pro splits tests across parallel CI nodes and ensures each parallel
@@ -449,8 +445,6 @@ test_files:
449
445
  - spec/knapsack_pro/config/ci/heroku_spec.rb
450
446
  - spec/knapsack_pro/config/ci/semaphore2_spec.rb
451
447
  - spec/knapsack_pro/config/ci/semaphore_spec.rb
452
- - spec/knapsack_pro/config/ci/snap_ci_spec.rb
453
- - spec/knapsack_pro/config/ci/solano_ci_spec.rb
454
448
  - spec/knapsack_pro/config/ci/travis_spec.rb
455
449
  - spec/knapsack_pro/config/env_generator_spec.rb
456
450
  - spec/knapsack_pro/config/env_spec.rb
@@ -1,35 +0,0 @@
1
- module KnapsackPro
2
- module Config
3
- module CI
4
- class SnapCI < Base
5
- def node_total
6
- ENV['SNAP_WORKER_TOTAL']
7
- end
8
-
9
- def node_index
10
- index = ENV['SNAP_WORKER_INDEX']
11
- index.to_i - 1 if index
12
- end
13
-
14
- def node_build_id
15
- ENV['SNAP_PIPELINE_COUNTER']
16
- end
17
-
18
- def commit_hash
19
- ENV['SNAP_COMMIT']
20
- end
21
-
22
- # https://docs.snap-ci.com/environment-variables/
23
- # SNAP_BRANCH - the name of the git branch (not present on pull requests)
24
- # SNAP_UPSTREAM_BRANCH - the upstream branch for which the pull request was opened
25
- def branch
26
- ENV['SNAP_BRANCH'] || ENV['SNAP_UPSTREAM_BRANCH']
27
- end
28
-
29
- def project_dir
30
- ENV['SNAP_WORKING_DIR']
31
- end
32
- end
33
- end
34
- end
35
- end
@@ -1,32 +0,0 @@
1
- # http://docs.solanolabs.com/Setup/tddium-set-environment-variables/
2
- module KnapsackPro
3
- module Config
4
- module CI
5
- class SolanoCI < Base
6
- def node_total
7
- # not provided
8
- end
9
-
10
- def node_index
11
- # not provided
12
- end
13
-
14
- def node_build_id
15
- ENV['TDDIUM_SESSION_ID']
16
- end
17
-
18
- def commit_hash
19
- ENV['TDDIUM_CURRENT_COMMIT']
20
- end
21
-
22
- def branch
23
- ENV['TDDIUM_CURRENT_BRANCH']
24
- end
25
-
26
- def project_dir
27
- ENV['TDDIUM_REPO_ROOT']
28
- end
29
- end
30
- end
31
- end
32
- end
@@ -1,104 +0,0 @@
1
- describe KnapsackPro::Config::CI::SnapCI 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) { { 'SNAP_WORKER_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) { { 'SNAP_WORKER_INDEX' => 4 } }
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) { { 'SNAP_PIPELINE_COUNTER' => 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) { { 'SNAP_COMMIT' => '3fa64859337f6e56409d49f865d13fd7' } }
54
- it { should eql '3fa64859337f6e56409d49f865d13fd7' }
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
- context 'when branch present' do
67
- let(:env) { { 'SNAP_BRANCH' => 'master' } }
68
- it { should eql 'master' }
69
- end
70
-
71
- context 'when pull request' do
72
- let(:env) { { 'SNAP_UPSTREAM_BRANCH' => 'feature-branch' } }
73
- it { should eql 'feature-branch' }
74
- end
75
-
76
- context 'branch has higher priority' do
77
- let(:env) do
78
- {
79
- 'SNAP_BRANCH' => 'master',
80
- 'SNAP_UPSTREAM_BRANCH' => 'feature-branch'
81
- }
82
- end
83
- it { should eql 'master' }
84
- end
85
- end
86
-
87
- context "when environment doesn't exist" do
88
- it { should be nil }
89
- end
90
- end
91
-
92
- describe '#project_dir' do
93
- subject { described_class.new.project_dir }
94
-
95
- context 'when environment exists' do
96
- let(:env) { { 'SNAP_WORKING_DIR' => '/var/snap-ci/repo' } }
97
- it { should eql '/var/snap-ci/repo' }
98
- end
99
-
100
- context "when environment doesn't exist" do
101
- it { should be nil }
102
- end
103
- end
104
- end
@@ -1,73 +0,0 @@
1
- describe KnapsackPro::Config::CI::SolanoCI 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
- it { should be nil }
14
- end
15
-
16
- describe '#node_index' do
17
- subject { described_class.new.node_index }
18
-
19
- it { should be nil }
20
- end
21
-
22
- describe '#node_build_id' do
23
- subject { described_class.new.node_build_id }
24
-
25
- context 'when environment exists' do
26
- let(:env) { { 'TDDIUM_SESSION_ID' => 123 } }
27
- it { should eql 123 }
28
- end
29
-
30
- context "when environment doesn't exist" do
31
- it { should be nil }
32
- end
33
- end
34
-
35
- describe '#commit_hash' do
36
- subject { described_class.new.commit_hash }
37
-
38
- context 'when environment exists' do
39
- let(:env) { { 'TDDIUM_CURRENT_COMMIT' => '2e13512fc230d6f9ebf4923352718e4d' } }
40
- it { should eql '2e13512fc230d6f9ebf4923352718e4d' }
41
- end
42
-
43
- context "when environment doesn't exist" do
44
- it { should be nil }
45
- end
46
- end
47
-
48
- describe '#branch' do
49
- subject { described_class.new.branch }
50
-
51
- context 'when environment exists' do
52
- let(:env) { { 'TDDIUM_CURRENT_BRANCH' => 'master' } }
53
- it { should eql 'master' }
54
- end
55
-
56
- context "when environment doesn't exist" do
57
- it { should be nil }
58
- end
59
- end
60
-
61
- describe '#project_dir' do
62
- subject { described_class.new.project_dir }
63
-
64
- context 'when environment exists' do
65
- let(:env) { { 'TDDIUM_REPO_ROOT' => '/example/repo/root' } }
66
- it { should eql '/example/repo/root' }
67
- end
68
-
69
- context "when environment doesn't exist" do
70
- it { should be nil }
71
- end
72
- end
73
- end