Skip to content

Commit

Permalink
fix: improve per-process calculation precision rounding
Browse files Browse the repository at this point in the history
test: add artificial loading delay to visualise loading time capture
  • Loading branch information
smileart committed Mar 2, 2021
1 parent b2095d3 commit d0afa93
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
turbo_tests (1.2.1)
turbo_tests (1.2.2)
bundler
parallel_tests (~> 3.3)
rspec (~> 3.10.0)
Expand Down
2 changes: 1 addition & 1 deletion lib/turbo_tests/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def report_number_of_tests(groups)

num_processes = groups.size
num_tests = groups.map(&:size).sum
tests_per_process = (num_processes == 0 ? 0 : num_tests / num_processes)
tests_per_process = (num_processes == 0 ? 0 : num_tests.to_f / num_processes).round

puts "#{num_processes} processes for #{num_tests} #{name}s, ~ #{tests_per_process} #{name}s per process"
end
Expand Down
2 changes: 2 additions & 0 deletions spec/doc_formatter_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
sleep 3

RSpec.describe "Top-level context" do
describe "#instance_method" do
it "does what it's supposed to" do
Expand Down

0 comments on commit d0afa93

Please sign in to comment.