knapsack_pro 5.1.1 → 5.1.2

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: 58063b1846ea84151755a05ad9f4cca8297246b78ff0c47d140576cb0d32e19c
4
- data.tar.gz: bf36f5e4232ae62eb835dea8f6aeb0d767f5bef88e7aabf7fea2508c8017068a
3
+ metadata.gz: fdfe0b2398cdf5c6f7721d4984569bc0adce8438406e97b005868c9f32478b24
4
+ data.tar.gz: '09411e2a2b2cddb9d5dd1e6cdb544c1b7b2898058155d135850836c7409b8551'
5
5
  SHA512:
6
- metadata.gz: 756a63cd54c3e35e60cd09ba057c026d5ab279dab5bdd295bccfb49c6f235f68835e956171a19d9a8c5ca21db46de204e22867c879dae331fe482ffefe906189
7
- data.tar.gz: 54e7d11084f8eab1ace9e225f0a1455dd9b391f33742cafa475b2ce144024f8509d7afcb0915f663784f0ead5407b7accee33d90acb19c44a6ab845c8507e0b5
6
+ metadata.gz: 822b2c1ef56ebaf68fbe24800511cdcd3cab21ef0aa8a74fb38a9cf85f682587cf41d59b7c347fa8609458ed35886215f535587016022c2952a5867441fe8f90
7
+ data.tar.gz: c2a94c2a81befbc09f0b7d77b656335275c028bc1ea40c1c06ad07f60e1623a3b0a4079eba83525234f6f7e460d3f8b067cd274fa4e0adfd1835d903df8f25d2
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ### 5.1.2
4
+
5
+ * Fix broken RSpec split by test examples feature when `SPEC_OPTS` is set in Queue Mode. Ignore `SPEC_OPTS` when generating test examples report for slow test files.
6
+
7
+ https://github.com/KnapsackPro/knapsack_pro-ruby/pull/191
8
+
9
+ https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v5.1.1...v5.1.2
10
+
3
11
  ### 5.1.1
4
12
 
5
13
  * Use `KNAPSACK_PRO_FIXED_QUEUE_SPLIT=true` as default value in Queue Mode for GitLab CI
@@ -87,6 +87,7 @@ module KnapsackPro
87
87
  all_test_file_paths += test_file_paths
88
88
  cli_args = args + test_file_paths
89
89
 
90
+ ensure_spec_opts_have_rspec_queue_summary_formatter
90
91
  options = ::RSpec::Core::ConfigurationOptions.new(cli_args)
91
92
  rspec_runner = ::RSpec::Core::Runner.new(options)
92
93
 
@@ -113,6 +114,15 @@ module KnapsackPro
113
114
  end
114
115
  end
115
116
 
117
+ def self.ensure_spec_opts_have_rspec_queue_summary_formatter
118
+ spec_opts = ENV['SPEC_OPTS']
119
+
120
+ return unless spec_opts
121
+ return if spec_opts.include?(KnapsackPro::Formatters::RSpecQueueSummaryFormatter.to_s)
122
+
123
+ ENV['SPEC_OPTS'] = "#{spec_opts} --format #{KnapsackPro::Formatters::RSpecQueueSummaryFormatter.to_s}"
124
+ end
125
+
116
126
  private
117
127
 
118
128
  def self.adapter_class
@@ -1,3 +1,3 @@
1
1
  module KnapsackPro
2
- VERSION = '5.1.1'
2
+ VERSION = '5.1.2'
3
3
  end
data/lib/tasks/rspec.rake CHANGED
@@ -7,6 +7,9 @@ namespace :knapsack_pro do
7
7
 
8
8
  desc "Generate JSON report for test suite based on default test pattern or based on defined pattern with ENV vars"
9
9
  task :rspec_test_example_detector do
10
+ # ignore the `SPEC_OPTS` options to not affect RSpec execution within this rake task
11
+ ENV.delete('SPEC_OPTS')
12
+
10
13
  detector = KnapsackPro::TestCaseDetectors::RSpecTestExampleDetector.new
11
14
  detector.generate_json_report
12
15
  end
@@ -212,6 +212,7 @@ describe KnapsackPro::Runners::Queue::RSpecRunner do
212
212
  expect(tracker).to receive(:reset!)
213
213
  expect(tracker).to receive(:set_prerun_tests).with(test_file_paths)
214
214
 
215
+ expect(described_class).to receive(:ensure_spec_opts_have_rspec_queue_summary_formatter)
215
216
  options = double
216
217
  expect(RSpec::Core::ConfigurationOptions).to receive(:new).with([
217
218
  '--no-color',
@@ -339,4 +340,39 @@ describe KnapsackPro::Runners::Queue::RSpecRunner do
339
340
  end
340
341
  end
341
342
  end
343
+
344
+ describe '.ensure_spec_opts_have_rspec_queue_summary_formatter' do
345
+ subject { described_class.ensure_spec_opts_have_rspec_queue_summary_formatter }
346
+
347
+ context 'when `SPEC_OPTS` is set' do
348
+ context 'when `SPEC_OPTS` has RSpec Queue Summary Formatter' do
349
+ before do
350
+ stub_const('ENV', { 'SPEC_OPTS' => '--format json --format KnapsackPro::Formatters::RSpecQueueSummaryFormatter' })
351
+ end
352
+
353
+ it 'does nothing' do
354
+ subject
355
+ expect(ENV['SPEC_OPTS']).to eq '--format json --format KnapsackPro::Formatters::RSpecQueueSummaryFormatter'
356
+ end
357
+ end
358
+
359
+ context 'when `SPEC_OPTS` has no RSpec Queue Summary Formatter' do
360
+ before do
361
+ stub_const('ENV', { 'SPEC_OPTS' => '--format json' })
362
+ end
363
+
364
+ it 'adds RSpec Queue Summary Formatter to `SPEC_OPTS`' do
365
+ subject
366
+ expect(ENV['SPEC_OPTS']).to eq '--format json --format KnapsackPro::Formatters::RSpecQueueSummaryFormatter'
367
+ end
368
+ end
369
+ end
370
+
371
+ context 'when `SPEC_OPTS` is not set' do
372
+ it 'does nothing' do
373
+ subject
374
+ expect(ENV['SPEC_OPTS']).to be_nil
375
+ end
376
+ end
377
+ end
342
378
  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: 5.1.1
4
+ version: 5.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ArturT
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-19 00:00:00.000000000 Z
11
+ date: 2023-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake