Skip to content

Commit

Permalink
use new name for ITR - test optimisation
Browse files Browse the repository at this point in the history
  • Loading branch information
anmarchenko committed Jul 22, 2024
1 parent c050ca4 commit 1e0c89a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/tasks/rspec.rake
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ namespace :datadog do
Datadog.logger.error("RSpec dry-run failed with exit code #{exit_code}")
end

itr = Datadog.send(:components).itr
print((itr.skipped_tests_count.to_f / itr.total_tests_count).floor(2))
test_optimisation = Datadog.send(:components).test_optimisation
print((test_optimisation.skipped_tests_count.to_f / test_optimisation.total_tests_count).floor(2))
end

task skippable_percentage_estimate: :environment do
Expand All @@ -47,9 +47,9 @@ namespace :datadog do
test_session = Datadog::CI.start_test_session
test_session&.finish

itr = Datadog.send(:components).itr
test_optimisation = Datadog.send(:components).test_optimisation

skippable_tests_count = itr.skippable_tests.count
skippable_tests_count = test_optimisation.skippable_tests.count
estimated_tests_count = Dir["spec/**/*_spec.rb"].map { |path| File.read(path) }.join.scan(/( it)|( scenario)/).count

result = [(skippable_tests_count.to_f / estimated_tests_count).floor(2), 0.99].min
Expand Down

0 comments on commit 1e0c89a

Please sign in to comment.