knapsack_pro 2.14.0 → 2.15.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a97f9fbc29f0a109fbbf35b6a544f2ad86208feb697b7ff81f8458b679843c91
|
4
|
+
data.tar.gz: 434871e67293512331dfe99ed7915eb0f96ae27d2a7b3a1023e8752c752455ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d5be26f0d227707d789b5d7243f3617ea6f839154725b555f0ada89b6600aef0b18aaa2532d018344c797a1f79465e27d3caadebb955d1ca00684b08f1be4ea
|
7
|
+
data.tar.gz: ddb85043aad801bbb9f47f51c36bace0c34b73f958968e821c7b2e8845cc0a302ef05d9e55033d260a86817d4a99d924084f8c29c86b87ce2c2a75fd96fef4af
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
### 2.15.0
|
4
|
+
|
5
|
+
* Do not allow to use the RSpec tag option together with the RSpec split by test examples feature
|
6
|
+
|
7
|
+
https://github.com/KnapsackPro/knapsack_pro-ruby/pull/139
|
8
|
+
|
9
|
+
https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v2.14.0...v2.15.0
|
10
|
+
|
3
11
|
### 2.14.0
|
4
12
|
|
5
13
|
* Track time spend in RSpec context hook
|
@@ -14,12 +14,18 @@ module KnapsackPro
|
|
14
14
|
runner = new(KnapsackPro::Adapters::RSpecAdapter)
|
15
15
|
|
16
16
|
cli_args = (args || '').split
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
17
|
+
|
18
|
+
if KnapsackPro::Config::Env.rspec_split_by_test_examples? && has_tag_option?(cli_args)
|
19
|
+
error_message = 'It is not allowed to use the RSpec tag option together with the RSpec split by test examples feature. Please see: https://knapsackpro.com/faq/question/how-to-split-slow-rspec-test-files-by-test-examples-by-individual-it#warning-dont-use-rspec-tag-option'
|
20
|
+
KnapsackPro.logger.error(error_message)
|
21
|
+
raise error_message
|
21
22
|
end
|
23
|
+
|
24
|
+
# when format option is not defined by user then use progress formatter to show tests execution progress
|
25
|
+
cli_args += ['--format', 'progress'] unless has_format_option?(cli_args)
|
26
|
+
|
22
27
|
cli_args += [
|
28
|
+
# shows summary of all tests executed in Queue Mode at the very end
|
23
29
|
'--format', KnapsackPro::Formatters::RSpecQueueSummaryFormatter.to_s,
|
24
30
|
'--default-path', runner.test_dir,
|
25
31
|
]
|
@@ -148,6 +154,19 @@ module KnapsackPro
|
|
148
154
|
::RSpec.configuration.reset_filters
|
149
155
|
end
|
150
156
|
end
|
157
|
+
|
158
|
+
def self.has_tag_option?(cli_args)
|
159
|
+
# use start_with? because user can define tag option in a few ways:
|
160
|
+
# -t mytag
|
161
|
+
# -tmytag
|
162
|
+
# --tag mytag
|
163
|
+
# --tag=mytag
|
164
|
+
cli_args.any? { |arg| arg.start_with?('-t') || arg.start_with?('--tag') }
|
165
|
+
end
|
166
|
+
|
167
|
+
def self.has_format_option?(cli_args)
|
168
|
+
cli_args.any? { |arg| arg.start_with?('-f') || arg.start_with?('--format') }
|
169
|
+
end
|
151
170
|
end
|
152
171
|
end
|
153
172
|
end
|
data/lib/knapsack_pro/version.rb
CHANGED
@@ -30,7 +30,7 @@ describe KnapsackPro::Runners::Queue::RSpecRunner do
|
|
30
30
|
end
|
31
31
|
|
32
32
|
context 'when args provided' do
|
33
|
-
context 'when format
|
33
|
+
context 'when format option is not provided' do
|
34
34
|
let(:args) { '--example-arg example-value' }
|
35
35
|
|
36
36
|
it 'uses default formatter progress' do
|
@@ -55,10 +55,10 @@ describe KnapsackPro::Runners::Queue::RSpecRunner do
|
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
58
|
-
context 'when format
|
58
|
+
context 'when format option is provided as --format' do
|
59
59
|
let(:args) { '--format documentation' }
|
60
60
|
|
61
|
-
it 'uses provided format
|
61
|
+
it 'uses provided format option instead of default formatter progress' do
|
62
62
|
expected_exitstatus = 0
|
63
63
|
expected_accumulator = {
|
64
64
|
status: :completed,
|
@@ -80,10 +80,10 @@ describe KnapsackPro::Runners::Queue::RSpecRunner do
|
|
80
80
|
end
|
81
81
|
end
|
82
82
|
|
83
|
-
context 'when format
|
83
|
+
context 'when format option is provided as -f' do
|
84
84
|
let(:args) { '-f d' }
|
85
85
|
|
86
|
-
it 'uses provided format
|
86
|
+
it 'uses provided format option instead of default formatter progress' do
|
87
87
|
expected_exitstatus = 0
|
88
88
|
expected_accumulator = {
|
89
89
|
status: :completed,
|
@@ -105,10 +105,10 @@ describe KnapsackPro::Runners::Queue::RSpecRunner do
|
|
105
105
|
end
|
106
106
|
end
|
107
107
|
|
108
|
-
context 'when format
|
108
|
+
context 'when format option is provided without a delimiter' do
|
109
109
|
let(:args) { '-fMyCustomFormatter' }
|
110
110
|
|
111
|
-
it 'uses provided format
|
111
|
+
it 'uses provided format option instead of default formatter progress' do
|
112
112
|
expected_exitstatus = 0
|
113
113
|
expected_accumulator = {
|
114
114
|
status: :completed,
|
@@ -129,6 +129,36 @@ describe KnapsackPro::Runners::Queue::RSpecRunner do
|
|
129
129
|
subject
|
130
130
|
end
|
131
131
|
end
|
132
|
+
|
133
|
+
context 'when RSpec split by test examples feature is enabled' do
|
134
|
+
before do
|
135
|
+
expect(KnapsackPro::Config::Env).to receive(:rspec_split_by_test_examples?).and_return(true)
|
136
|
+
end
|
137
|
+
|
138
|
+
context 'when tag option is provided as --tag' do
|
139
|
+
let(:args) { '--tag example-value' }
|
140
|
+
|
141
|
+
it do
|
142
|
+
expect { subject }.to raise_error(/It is not allowed to use the RSpec tag option together with the RSpec split by test examples feature/)
|
143
|
+
end
|
144
|
+
end
|
145
|
+
|
146
|
+
context 'when tag option is provided as -t' do
|
147
|
+
let(:args) { '-t example-value' }
|
148
|
+
|
149
|
+
it do
|
150
|
+
expect { subject }.to raise_error(/It is not allowed to use the RSpec tag option together with the RSpec split by test examples feature/)
|
151
|
+
end
|
152
|
+
end
|
153
|
+
|
154
|
+
context 'when tag option is provided without delimiter' do
|
155
|
+
let(:args) { '-texample-value' }
|
156
|
+
|
157
|
+
it do
|
158
|
+
expect { subject }.to raise_error(/It is not allowed to use the RSpec tag option together with the RSpec split by test examples feature/)
|
159
|
+
end
|
160
|
+
end
|
161
|
+
end
|
132
162
|
end
|
133
163
|
|
134
164
|
context 'when args not provided' do
|
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: 2.
|
4
|
+
version: 2.15.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ArturT
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-04-
|
11
|
+
date: 2021-04-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|