knapsack_pro 8.0.0 → 8.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/lib/knapsack_pro/adapters/rspec_adapter.rb +4 -2
- data/lib/knapsack_pro/version.rb +1 -1
- data/spec/knapsack_pro/adapters/rspec_adapter_spec.rb +21 -3
- metadata +3 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cc4bed2e7600e26f350d8f1847550aaea7be38b032a029a589e6082dbb31b31c
|
4
|
+
data.tar.gz: 2a66e48a7ccb7be83a553a2746611ce5addeac2114aa469c75f6a6faa3ee70a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cca2870484c23ce7aed1ab44b43a8ba4c862d37c2c9a29ec54b627433fef05cb43f0126a611e888ffb0a5cbc8fe13e01f7b97dd7c61b64404771a0a2c190db70
|
7
|
+
data.tar.gz: 6db4e20ea3aaa81b1467971435688667004576402bb9f686a0287f3c54d82dab84c1271ef78605e46d5d4050e634cc3d8e229dffd81a3d8646e3eb81b68eebad
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
### 8.0.1
|
4
|
+
|
5
|
+
* Fix detection of id paths for Turnip, which resulted in sending to the API both file and id paths timings
|
6
|
+
* Example:
|
7
|
+
* turnip/acceptance/foo.feature[1:1:1] 0 seconds
|
8
|
+
* turnip/acceptance/foo.feature[1:1:2] 0 seconds
|
9
|
+
* turnip/acceptance/foo.feature 30 milliseconds (time recorded for [1:1:1] or [1:1:2])
|
10
|
+
|
11
|
+
https://github.com/KnapsackPro/knapsack_pro-ruby/pull/290
|
12
|
+
|
13
|
+
https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v8.0.0...v8.0.1
|
14
|
+
|
3
15
|
### 8.0.0
|
4
16
|
|
5
17
|
* Enable [`KNAPSACK_PRO_RSPEC_SPLIT_BY_TEST_EXAMPLES`](https://docs.knapsackpro.com/ruby/split-by-test-examples/) by default
|
@@ -6,7 +6,8 @@ module KnapsackPro
|
|
6
6
|
module Adapters
|
7
7
|
class RSpecAdapter < BaseAdapter
|
8
8
|
TEST_DIR_PATTERN = 'spec/**{,/*/**}/*_spec.rb'
|
9
|
-
|
9
|
+
# https://github.com/rspec/rspec/blob/86b5e4218eece4c1913fe9aad24c0a96d8bc9f40/rspec-core/lib/rspec/core/example.rb#L122
|
10
|
+
REGEX = /^(.*?)(?:\[([\d\s:,]+)\])?$/.freeze
|
10
11
|
|
11
12
|
def self.split_by_test_cases_enabled?
|
12
13
|
return false unless KnapsackPro::Config::Env.rspec_split_by_test_examples?
|
@@ -81,7 +82,8 @@ module KnapsackPro
|
|
81
82
|
end
|
82
83
|
|
83
84
|
def self.id_path?(path)
|
84
|
-
|
85
|
+
_file, id = path.match(REGEX).captures
|
86
|
+
!id.nil?
|
85
87
|
end
|
86
88
|
|
87
89
|
def self.rails_helper_exists?(test_dir)
|
data/lib/knapsack_pro/version.rb
CHANGED
@@ -148,23 +148,41 @@ describe KnapsackPro::Adapters::RSpecAdapter do
|
|
148
148
|
describe '.id_path?' do
|
149
149
|
subject { described_class.id_path?(path) }
|
150
150
|
|
151
|
-
context 'when the path
|
151
|
+
context 'when the path is an RSpec path with id' do
|
152
152
|
let(:path) { 'spec/features/a_spec.rb[1:1:7:1]' }
|
153
153
|
|
154
154
|
it { is_expected.to be true }
|
155
155
|
end
|
156
156
|
|
157
|
-
context 'when the path
|
157
|
+
context 'when the path is an RSpec path with multiple ids' do
|
158
158
|
let(:path) { 'spec/features/a_spec.rb[1:1:7:1, 1:2]' }
|
159
159
|
|
160
160
|
it { is_expected.to be true }
|
161
161
|
end
|
162
162
|
|
163
|
-
context
|
163
|
+
context 'when the path is an RSpec path with no id' do
|
164
164
|
let(:path) { 'spec/features/a_spec.rb' }
|
165
165
|
|
166
166
|
it { is_expected.to be false }
|
167
167
|
end
|
168
|
+
|
169
|
+
context 'when the path is a Turnip path with id' do
|
170
|
+
let(:path) { 'spec/acceptance/a.feature[1:1:7:1]' }
|
171
|
+
|
172
|
+
it { is_expected.to be true }
|
173
|
+
end
|
174
|
+
|
175
|
+
context 'when the path is a Turnip path with multiple ids' do
|
176
|
+
let(:path) { 'spec/acceptance/a.feature[1:1:7:1,1:2]' }
|
177
|
+
|
178
|
+
it { is_expected.to be true }
|
179
|
+
end
|
180
|
+
|
181
|
+
context 'when the path is a Turnip path with no id' do
|
182
|
+
let(:path) { 'spec/acceptance/a.feature' }
|
183
|
+
|
184
|
+
it { is_expected.to be false }
|
185
|
+
end
|
168
186
|
end
|
169
187
|
|
170
188
|
describe '.rails_helper_exists?' do
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: knapsack_pro
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 8.0.
|
4
|
+
version: 8.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ArturT
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date: 2025-
|
10
|
+
date: 2025-03-06 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: rake
|
@@ -418,7 +417,6 @@ metadata:
|
|
418
417
|
documentation_uri: https://docs.knapsackpro.com/knapsack_pro-ruby/guide/
|
419
418
|
homepage_uri: https://knapsackpro.com
|
420
419
|
source_code_uri: https://github.com/KnapsackPro/knapsack_pro-ruby
|
421
|
-
post_install_message:
|
422
420
|
rdoc_options: []
|
423
421
|
require_paths:
|
424
422
|
- lib
|
@@ -433,8 +431,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
433
431
|
- !ruby/object:Gem::Version
|
434
432
|
version: '0'
|
435
433
|
requirements: []
|
436
|
-
rubygems_version: 3.
|
437
|
-
signing_key:
|
434
|
+
rubygems_version: 3.6.2
|
438
435
|
specification_version: 4
|
439
436
|
summary: Knapsack Pro splits tests across parallel CI nodes and ensures each parallel
|
440
437
|
job finish work at a similar time.
|