Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

### UNRELEASED (patch)

### 8.3.3

* Fix a `Hash#sum` bug in the time tracker for RSpec

https://github.com/KnapsackPro/knapsack_pro-ruby/pull/305

https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v8.3.2...v8.3.3

### 8.3.2

* Fix infinite recursion when the logger enters a loop. [The issue](https://github.com/KnapsackPro/knapsack_pro-ruby/issues/269) occurs when `KNAPSACK_PRO_LOG_DIR=log` is set and a conflict arises between the values of environment variables from the CI provider and those configured by the user (e.g., `KNAPSACK_PRO_CI_NODE_INDEX`, `KNAPSACK_PRO_CI_NODE_TOTAL`).
Expand Down
8 changes: 4 additions & 4 deletions lib/knapsack_pro/formatters/time_tracker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,12 @@ def add_hooks_time(group, time_all_by_group_id_path)
group.each do |_, example|
next if example[:time_execution] == 0.0

example[:time_execution] += time_all_by_group_id_path.sum do |group_id_path, time|
example[:time_execution] += time_all_by_group_id_path.reduce(0.0) do |sum, (group_id_path, time)|
# :path is a file path (a_spec.rb), sum any before/after(:all) in the file
next time if group_id_path.start_with?(example[:path])
next sum + time if group_id_path.start_with?(example[:path])
# :path is an id path (a_spec.rb[1:1]), sum any before/after(:all) above it
next time if example[:path].start_with?(group_id_path[0..-2])
0
next sum + time if example[:path].start_with?(group_id_path[0..-2])
sum
end
end
end
Expand Down