knapsack_pro 5.1.0 → 5.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +20 -0
- data/lib/knapsack_pro/config/ci/gitlab_ci.rb +1 -1
- data/lib/knapsack_pro/runners/queue/rspec_runner.rb +10 -0
- data/lib/knapsack_pro/version.rb +1 -1
- data/lib/tasks/rspec.rake +3 -0
- data/spec/knapsack_pro/config/env_spec.rb +1 -1
- data/spec/knapsack_pro/runners/queue/rspec_runner_spec.rb +36 -0
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fdfe0b2398cdf5c6f7721d4984569bc0adce8438406e97b005868c9f32478b24
|
4
|
+
data.tar.gz: '09411e2a2b2cddb9d5dd1e6cdb544c1b7b2898058155d135850836c7409b8551'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 822b2c1ef56ebaf68fbe24800511cdcd3cab21ef0aa8a74fb38a9cf85f682587cf41d59b7c347fa8609458ed35886215f535587016022c2952a5867441fe8f90
|
7
|
+
data.tar.gz: c2a94c2a81befbc09f0b7d77b656335275c028bc1ea40c1c06ad07f60e1623a3b0a4079eba83525234f6f7e460d3f8b067cd274fa4e0adfd1835d903df8f25d2
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,21 @@
|
|
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
|
+
|
11
|
+
### 5.1.1
|
12
|
+
|
13
|
+
* Use `KNAPSACK_PRO_FIXED_QUEUE_SPLIT=true` as default value in Queue Mode for GitLab CI
|
14
|
+
|
15
|
+
https://github.com/KnapsackPro/knapsack_pro-ruby/pull/206
|
16
|
+
|
17
|
+
https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v5.1.0...v5.1.1
|
18
|
+
|
3
19
|
### 5.1.0
|
4
20
|
|
5
21
|
* Mask user seats data instead of hashing it
|
@@ -19,6 +35,10 @@ https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v5.0.0...v5.1.0
|
|
19
35
|
|
20
36
|
https://github.com/KnapsackPro/knapsack_pro-ruby/pull/201
|
21
37
|
|
38
|
+
__(breaking change)__ for Buildkite. You need to pass the `BUILDKITE` environment variable to Docker Compose.
|
39
|
+
|
40
|
+
https://github.com/KnapsackPro/knapsack_pro-ruby/issues/204
|
41
|
+
|
22
42
|
* Set `RAILS_ENV=test` / `RACK_ENV=test` in Queue Mode
|
23
43
|
|
24
44
|
https://github.com/KnapsackPro/knapsack_pro-ruby/pull/199
|
@@ -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
|
data/lib/knapsack_pro/version.rb
CHANGED
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
|
@@ -728,7 +728,7 @@ describe KnapsackPro::Config::Env do
|
|
728
728
|
['Codefresh', { 'CF_BUILD_ID' => '123' }, false],
|
729
729
|
['Codeship', { 'CI_NAME' => 'codeship' }, true],
|
730
730
|
['GitHub Actions', { 'GITHUB_ACTIONS' => 'true' }, true],
|
731
|
-
['GitLab CI', { 'GITLAB_CI' => 'true' },
|
731
|
+
['GitLab CI', { 'GITLAB_CI' => 'true' }, true],
|
732
732
|
['Heroku CI', { 'HEROKU_TEST_RUN_ID' => '123' }, false],
|
733
733
|
['Semaphore CI 1.0', { 'SEMAPHORE_BUILD_NUMBER' => '123' }, false],
|
734
734
|
['Semaphore CI 2.0', { 'SEMAPHORE' => 'true', 'SEMAPHORE_WORKFLOW_ID' => '123' }, false],
|
@@ -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.
|
4
|
+
version: 5.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ArturT
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-06-
|
11
|
+
date: 2023-06-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -389,7 +389,7 @@ metadata:
|
|
389
389
|
documentation_uri: https://docs.knapsackpro.com/integration/
|
390
390
|
homepage_uri: https://knapsackpro.com
|
391
391
|
source_code_uri: https://github.com/KnapsackPro/knapsack_pro-ruby
|
392
|
-
post_install_message:
|
392
|
+
post_install_message:
|
393
393
|
rdoc_options: []
|
394
394
|
require_paths:
|
395
395
|
- lib
|
@@ -404,8 +404,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
404
404
|
- !ruby/object:Gem::Version
|
405
405
|
version: '0'
|
406
406
|
requirements: []
|
407
|
-
rubygems_version: 3.
|
408
|
-
signing_key:
|
407
|
+
rubygems_version: 3.4.10
|
408
|
+
signing_key:
|
409
409
|
specification_version: 4
|
410
410
|
summary: Knapsack Pro splits tests across parallel CI nodes and ensures each parallel
|
411
411
|
job finish work at a similar time.
|