knapsack_pro 7.5.1 → 7.6.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: 1c0358e24e8030869e858b896df6bbb3188433fcd973e073e773e6f6735b481a
4
- data.tar.gz: 33c9a7233e1fc1c14450d3e72eea10568bbab8dd37c90df93db37253db78b8b3
3
+ metadata.gz: 4c20774d9ffe521fc4a3a137558b47c79cc27b085e96f2b00d3a61711e43f0c9
4
+ data.tar.gz: af712f88ca12cf15de791d3b755fc75d6a527e938034d835ddaa0e07b77a5fd2
5
5
  SHA512:
6
- metadata.gz: 43966d1dc8df454ede86e53226927e43f7d622e7605a04b1eb6331ca33e8e1c5e5ab7ba3e1ed9e9616088bd729cf95baf5aa28503ab36062828869ef5d5a8943
7
- data.tar.gz: f1ace143ed62bbbb8d210470990cbf44baeef4473c23d5a303ad28fbf9aa8708ad04c95f920639af588406a7541542c2db8a04db7021c7144a583cc6c120ba41
6
+ metadata.gz: ad574926a94e992932fbc8538d15040535624631c22f3679ca3c39d4d304f2e87b0efa30c536eb2695698b419b3f9e58708f1e4e5afc83d6df565e4eae6c3e7b
7
+ data.tar.gz: 21365b7b89c96193c3ad9ae45657d6916760745b584f1552a7e85ac686b2de6e12d6b7203c8847e2cd09997b456462f742490cc4d140d42cf135ddbd5cc23865
data/CHANGELOG.md CHANGED
@@ -2,9 +2,21 @@
2
2
 
3
3
  ### UNRELEASED
4
4
 
5
+ ### 7.6.0
6
+
7
+ * Avoid starting an unnecessary process in Queue Mode.
8
+ * Fix: the terminal is returned to the user correctly (output looks good) when you use CTRL+C
9
+ * Improvement: the backtrace looks better when something fails (for example, the gem handles an OS signal)
10
+
11
+ https://github.com/KnapsackPro/knapsack_pro-ruby/pull/260
12
+
13
+ https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v7.5.1...v7.6.0
14
+
5
15
  ### 7.5.1
6
16
 
7
- Revert to 7.4.0.
17
+ * Revert to 7.4.0.
18
+
19
+ https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v7.5.0...v7.5.1
8
20
 
9
21
  ### 7.5.0
10
22
 
@@ -233,6 +245,34 @@ https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v6.0.4...v7.0.0
233
245
 
234
246
  https://github.com/KnapsackPro/knapsack_pro-ruby/pull/236
235
247
 
248
+ __(breaking change)__ for SimpleCov and Minitest in Knapsack Pro Queue Mode users.
249
+
250
+ Please add the following to your configuration:
251
+
252
+ ```ruby
253
+ KnapsackPro::Hooks::Queue.after_queue do
254
+ SimpleCov.result.format!
255
+ end
256
+ ```
257
+
258
+ The full example:
259
+
260
+ ```ruby
261
+ # test/test_helper.rb
262
+ require 'knapsack_pro'
263
+ require 'simplecov'
264
+
265
+ SimpleCov.start
266
+
267
+ KnapsackPro::Hooks::Queue.before_queue do |queue_id|
268
+ SimpleCov.command_name("minitest_ci_node_#{KnapsackPro::Config::Env.ci_node_index}")
269
+ end
270
+
271
+ KnapsackPro::Hooks::Queue.after_queue do
272
+ SimpleCov.result.format!
273
+ end
274
+ ```
275
+
236
276
  https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v6.0.3...v6.0.4
237
277
 
238
278
  ### 6.0.3
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module KnapsackPro
4
- VERSION = '7.5.1'
4
+ VERSION = '7.6.0'
5
5
  end
@@ -5,14 +5,7 @@ require 'knapsack_pro'
5
5
  namespace :knapsack_pro do
6
6
  namespace :queue do
7
7
  task :cucumber, [:cucumber_args] do |_, args|
8
- Kernel.system("RAILS_ENV=test RACK_ENV=test #{$PROGRAM_NAME} 'knapsack_pro:queue:cucumber_go[#{args[:cucumber_args]}]'")
9
- exitstatus = $?.exitstatus
10
- if exitstatus.nil?
11
- puts 'Something went wrong. Most likely, the process has been killed. Knapsack Pro has been terminated.'
12
- Kernel.exit(1)
13
- else
14
- Kernel.exit(exitstatus)
15
- end
8
+ Kernel.exec("RAILS_ENV=test RACK_ENV=test #{$PROGRAM_NAME} 'knapsack_pro:queue:cucumber_go[#{args[:cucumber_args]}]'")
16
9
  end
17
10
 
18
11
  task :cucumber_go, [:cucumber_args] do |_, args|
@@ -5,14 +5,7 @@ require 'knapsack_pro'
5
5
  namespace :knapsack_pro do
6
6
  namespace :queue do
7
7
  task :minitest, [:minitest_args] do |_, args|
8
- Kernel.system("RAILS_ENV=test RACK_ENV=test #{$PROGRAM_NAME} 'knapsack_pro:queue:minitest_go[#{args[:minitest_args]}]'")
9
- exitstatus = $?.exitstatus
10
- if exitstatus.nil?
11
- puts 'Something went wrong. Most likely, the process has been killed. Knapsack Pro has been terminated.'
12
- Kernel.exit(1)
13
- else
14
- Kernel.exit(exitstatus)
15
- end
8
+ Kernel.exec("RAILS_ENV=test RACK_ENV=test #{$PROGRAM_NAME} 'knapsack_pro:queue:minitest_go[#{args[:minitest_args]}]'")
16
9
  end
17
10
 
18
11
  task :minitest_go, [:minitest_args] do |_, args|
@@ -5,14 +5,7 @@ require 'knapsack_pro'
5
5
  namespace :knapsack_pro do
6
6
  namespace :queue do
7
7
  task :rspec, [:rspec_args] do |_, args|
8
- Kernel.system("RAILS_ENV=test RACK_ENV=test #{$PROGRAM_NAME} 'knapsack_pro:queue:rspec_go[#{args[:rspec_args]}]'")
9
- exitstatus = $?.exitstatus
10
- if exitstatus.nil?
11
- puts 'Something went wrong. Most likely, the process has been killed. Knapsack Pro has been terminated.'
12
- Kernel.exit(1)
13
- else
14
- Kernel.exit(exitstatus)
15
- end
8
+ Kernel.exec("RAILS_ENV=test RACK_ENV=test #{$PROGRAM_NAME} 'knapsack_pro:queue:rspec_go[#{args[:rspec_args]}]'")
16
9
  end
17
10
 
18
11
  task :rspec_go, [:rspec_args] do |_, args|
@@ -18,18 +18,23 @@ describe "#{KnapsackPro::Runners::Queue::RSpecRunner} - Integration tests", :cle
18
18
  # @param spec_batches Array[Array[String]]
19
19
  def generate_specs(spec_helper, rspec_options, spec_batches)
20
20
  ENV['TEST__RSPEC_OPTIONS'] = rspec_options
21
+ generate_spec_helper(spec_helper)
22
+ paths = generate_spec_files(spec_batches.flatten)
23
+ stub_spec_batches(
24
+ spec_batches.map { _1.map(&:path) }
25
+ )
26
+ end
21
27
 
28
+ def generate_spec_helper(spec_helper)
22
29
  spec_helper_path = "#{SPEC_DIRECTORY}/spec_helper.rb"
23
30
  File.open(spec_helper_path, 'w') { |file| file.write(spec_helper) }
31
+ end
24
32
 
25
- paths = spec_batches.flatten.map do |spec_item|
33
+ def generate_spec_files(specs)
34
+ specs.map do |spec_item|
26
35
  File.open(spec_item.path, 'w') { |file| file.write(spec_item.content) }
27
36
  spec_item.path
28
37
  end
29
-
30
- stub_spec_batches(
31
- spec_batches.map { _1.map(&:path) }
32
- )
33
38
  end
34
39
 
35
40
  def create_rails_helper_file(rails_helper)
@@ -73,8 +78,9 @@ describe "#{KnapsackPro::Runners::Queue::RSpecRunner} - Integration tests", :cle
73
78
  SPEC
74
79
  end
75
80
 
81
+ let(:command) { 'ruby spec/integration/runners/queue/rspec_runner.rb' }
82
+
76
83
  subject do
77
- command = 'ruby spec/integration/runners/queue/rspec_runner.rb'
78
84
  stdout, stderr, status = Open3.capture3(command)
79
85
  log_command_result(stdout, stderr, status)
80
86
  OpenStruct.new(stdout: stdout, stderr: stderr, exit_code: status.exitstatus)
@@ -2537,4 +2543,28 @@ describe "#{KnapsackPro::Runners::Queue::RSpecRunner} - Integration tests", :cle
2537
2543
  expect(actual.exit_code).to eq 0
2538
2544
  end
2539
2545
  end
2546
+
2547
+ context 'when rspec is run without knapsack_pro' do
2548
+ let(:spec) { Spec.new('a_spec.rb', <<~SPEC) }
2549
+ require_relative "spec_helper.rb"
2550
+
2551
+ describe 'A_describe' do
2552
+ it 'A1 test example' do
2553
+ expect(1).to eq 1
2554
+ end
2555
+ end
2556
+ SPEC
2557
+
2558
+ let(:command) { "bundle exec rspec #{spec.path}" }
2559
+
2560
+ it 'runs successfully' do
2561
+ generate_spec_helper(spec_helper_with_knapsack)
2562
+ generate_spec_files([spec])
2563
+
2564
+ actual = subject
2565
+
2566
+ expect(actual.stdout).to include('1 example, 0 failures')
2567
+ expect(actual.exit_code).to eq 0
2568
+ end
2569
+ end
2540
2570
  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: 7.5.1
4
+ version: 7.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ArturT
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-05-28 00:00:00.000000000 Z
11
+ date: 2024-06-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -415,7 +415,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
415
415
  - !ruby/object:Gem::Version
416
416
  version: '0'
417
417
  requirements: []
418
- rubygems_version: 3.4.10
418
+ rubygems_version: 3.5.9
419
419
  signing_key:
420
420
  specification_version: 4
421
421
  summary: Knapsack Pro splits tests across parallel CI nodes and ensures each parallel