knapsack_pro 6.0.2 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 01f99e32731d4f72887d579cffe6f72dc955f8b18fa3527edd4c20a33290fb22
4
- data.tar.gz: bafeb90b8e27a7a8ad6d5cac4820947810887227646502f96a4a110eec205eb6
3
+ metadata.gz: '05131444388481496f61779bc12d4bb749111cf798d667d969664b5bd2668e08'
4
+ data.tar.gz: 9fb9f32b315e914e4f089ff0946a8204017740a23cf2fede172f4276b29dfcd4
5
5
  SHA512:
6
- metadata.gz: 66ce104356dab398f399b4a882eb7a296ba02fcfec84b025776cdcfb306c42a7ae3d1d35b9027ca5ff91e45d8f99cf1b1ea9201bfdddcb949397b7bb37f998d3
7
- data.tar.gz: 3947753ad22f500d9a8102fd5183f07dec1cb9fef884894da3da28bf03a8e7259cb88b0d8139893874db4367568f7a2b648d77276bd5f118cbc4afa6671eea63
6
+ metadata.gz: 786fc53dbf7b6c068c2135b3f1d29218b17a1d5155db591088a4642442b281e387afa1b8815a9ccd3adfd88da86aded5158a7f5110e09d057a021aa5ef563891
7
+ data.tar.gz: f771d87b9dcd3c2dd19cc5058d7a9dc3a56e1a2101cbaeff1210bda562bd0670341ce6f3e2f341f32a1f1e5cd49a165c96cd36999f109a7dad87a3adf7cc25ae
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
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
+
3
12
  ### 6.0.2
4
13
 
5
14
  * fix(RSpec): allow using `TimeTracker` in RSpec < 3.10.2 when formatters were required to expose `#output`
@@ -65,7 +65,7 @@ module KnapsackPro
65
65
  ]
66
66
  .each do |path|
67
67
  p = path.call
68
- return p if p.include?('_spec.rb')
68
+ return p if p.include?('_spec.rb') || p.include?('.feature')
69
69
  end
70
70
 
71
71
  return ''
@@ -115,8 +115,9 @@ module KnapsackPro
115
115
 
116
116
  def record_example(accumulator, example, started_at)
117
117
  path = path_for(example)
118
- time_execution = time_execution_for(example, started_at)
118
+ return if path.nil?
119
119
 
120
+ time_execution = time_execution_for(example, started_at)
120
121
  if accumulator.key?(path)
121
122
  accumulator[path][:time_execution] += time_execution
122
123
  else
@@ -126,7 +127,8 @@ module KnapsackPro
126
127
 
127
128
  def path_for(example)
128
129
  file = file_path_for(example)
129
- return "UNKNOWN_PATH" if file == ""
130
+ return nil if file == ""
131
+
130
132
  path = rspec_split_by_test_example?(file) ? example.id : file
131
133
  KnapsackPro::TestFileCleaner.clean(path)
132
134
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module KnapsackPro
4
- VERSION = '6.0.2'
4
+ VERSION = '6.0.3'
5
5
  end
@@ -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 == 2
284
- raise unless times[0]["path"] == "UNKNOWN_PATH"
285
- raise unless times[1]["path"] == spec_paths.first
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) || time["path"] == "UNKNOWN_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.2
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-06 00:00:00.000000000 Z
11
+ date: 2023-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake