knapsack_pro 6.0.1 → 6.0.3
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 +18 -1
- data/lib/knapsack_pro/adapters/rspec_adapter.rb +1 -1
- data/lib/knapsack_pro/formatters/time_tracker.rb +9 -2
- data/lib/knapsack_pro/version.rb +1 -1
- data/spec/knapsack_pro/adapters/rspec_adapter_spec.rb +9 -0
- data/spec/knapsack_pro/formatters/time_tracker_specs.rb +4 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '05131444388481496f61779bc12d4bb749111cf798d667d969664b5bd2668e08'
|
4
|
+
data.tar.gz: 9fb9f32b315e914e4f089ff0946a8204017740a23cf2fede172f4276b29dfcd4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 786fc53dbf7b6c068c2135b3f1d29218b17a1d5155db591088a4642442b281e387afa1b8815a9ccd3adfd88da86aded5158a7f5110e09d057a021aa5ef563891
|
7
|
+
data.tar.gz: f771d87b9dcd3c2dd19cc5058d7a9dc3a56e1a2101cbaeff1210bda562bd0670341ce6f3e2f341f32a1f1e5cd49a165c96cd36999f109a7dad87a3adf7cc25ae
|
data/CHANGELOG.md
CHANGED
@@ -1,8 +1,25 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
### 6.0.3
|
4
|
+
|
5
|
+
* fix(Turnip): make sure `.feature` files are recorded
|
6
|
+
* fix(RSpec): stop recording `UNKNOWN_PATH` that would generate an error in case of a CI node retry
|
7
|
+
|
8
|
+
https://github.com/KnapsackPro/knapsack_pro-ruby/pull/233
|
9
|
+
|
10
|
+
https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v6.0.2...v6.0.3
|
11
|
+
|
12
|
+
### 6.0.2
|
13
|
+
|
14
|
+
* fix(RSpec): allow using `TimeTracker` in RSpec < 3.10.2 when formatters were required to expose `#output`
|
15
|
+
|
16
|
+
https://github.com/KnapsackPro/knapsack_pro-ruby/pull/232
|
17
|
+
|
18
|
+
https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v6.0.1...v6.0.2
|
19
|
+
|
3
20
|
### 6.0.1
|
4
21
|
|
5
|
-
* fix(RSpec): allow
|
22
|
+
* fix(RSpec): allow using Queue Mode in RSpec <= 3.10 when the `rspec_is_quitting` method is not present for RSpec World object
|
6
23
|
|
7
24
|
https://github.com/KnapsackPro/knapsack_pro-ruby/pull/231
|
8
25
|
|
@@ -1,5 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'stringio'
|
4
|
+
|
3
5
|
module KnapsackPro
|
4
6
|
module Formatters
|
5
7
|
class TimeTracker
|
@@ -10,10 +12,13 @@ module KnapsackPro
|
|
10
12
|
:example_group_finished,
|
11
13
|
:stop
|
12
14
|
|
15
|
+
attr_reader :output # RSpec < v3.10.2
|
16
|
+
|
13
17
|
# Called at the beginning of each batch,
|
14
18
|
# but only the first instance of this class is used,
|
15
19
|
# so don't rely on the initializer to reset values.
|
16
20
|
def initialize(_output)
|
21
|
+
@output = StringIO.new
|
17
22
|
@time_each = nil
|
18
23
|
@time_all = nil
|
19
24
|
@before_all = 0.0
|
@@ -110,8 +115,9 @@ module KnapsackPro
|
|
110
115
|
|
111
116
|
def record_example(accumulator, example, started_at)
|
112
117
|
path = path_for(example)
|
113
|
-
|
118
|
+
return if path.nil?
|
114
119
|
|
120
|
+
time_execution = time_execution_for(example, started_at)
|
115
121
|
if accumulator.key?(path)
|
116
122
|
accumulator[path][:time_execution] += time_execution
|
117
123
|
else
|
@@ -121,7 +127,8 @@ module KnapsackPro
|
|
121
127
|
|
122
128
|
def path_for(example)
|
123
129
|
file = file_path_for(example)
|
124
|
-
return
|
130
|
+
return nil if file == ""
|
131
|
+
|
125
132
|
path = rspec_split_by_test_example?(file) ? example.id : file
|
126
133
|
KnapsackPro::TestFileCleaner.clean(path)
|
127
134
|
end
|
data/lib/knapsack_pro/version.rb
CHANGED
@@ -305,6 +305,15 @@ describe KnapsackPro::Adapters::RSpecAdapter do
|
|
305
305
|
expect(subject).to eq('')
|
306
306
|
end
|
307
307
|
end
|
308
|
+
|
309
|
+
context "when id does not end in .feature (nor _spec.rb)" do
|
310
|
+
it "returns the file_path" do
|
311
|
+
allow(current_example).to receive(:id).and_return("./foo.rb")
|
312
|
+
allow(current_example).to receive(:metadata).and_return(file_path: "./foo.feature")
|
313
|
+
|
314
|
+
expect(subject).to eq("./foo.feature")
|
315
|
+
end
|
316
|
+
end
|
308
317
|
end
|
309
318
|
|
310
319
|
describe 'bind methods' do
|
@@ -280,9 +280,9 @@ class TestTimeTracker
|
|
280
280
|
SPEC
|
281
281
|
|
282
282
|
run_specs(spec) do |spec_paths, times|
|
283
|
-
raise unless times.size ==
|
284
|
-
raise unless times[0]["path"] ==
|
285
|
-
raise unless times[
|
283
|
+
raise unless times.size == 1
|
284
|
+
raise unless times[0]["path"] == spec_paths.first
|
285
|
+
raise unless times[0]["time_execution"] == 0.0
|
286
286
|
end
|
287
287
|
|
288
288
|
ensure
|
@@ -431,7 +431,7 @@ class TestTimeTracker
|
|
431
431
|
.queue(paths)
|
432
432
|
.sort_by { |time| time["path"] }
|
433
433
|
.filter do |time|
|
434
|
-
paths.any? { |path| time["path"].start_with?(path)
|
434
|
+
paths.any? { |path| time["path"].start_with?(path) }
|
435
435
|
end
|
436
436
|
yield(paths, times, time_tracker)
|
437
437
|
|
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: 6.0.
|
4
|
+
version: 6.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ArturT
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-12-
|
11
|
+
date: 2023-12-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|