Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add rake task to compute a percentage of skippable tests for RSpec #194

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

anmarchenko
Copy link
Member

What does this PR do?

Motivation

Additional Notes

How to test the change?

@codecov-commenter
Copy link

codecov-commenter commented Jun 21, 2024

Codecov Report

Attention: Patch coverage is 88.46154% with 3 lines in your changes missing coverage. Please review.

Project coverage is 98.92%. Comparing base (12ed0e8) to head (4d8a92a).
Report is 4 commits behind head on main.

Files Patch % Lines
lib/datadog/ci/test_optimisation/component.rb 71.42% 2 Missing ⚠️
lib/datadog/ci/test_visibility/null_transport.rb 85.71% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #194      +/-   ##
==========================================
- Coverage   98.93%   98.92%   -0.01%     
==========================================
  Files         262      263       +1     
  Lines       12440    12457      +17     
  Branches      560      561       +1     
==========================================
+ Hits        12307    12323      +16     
- Misses        133      134       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

namespace :datadog do
namespace :ci do
namespace :rspec do
task :skippable_percentage do

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
task :skippable_percentage do
task skippable_percentage: :environment do

end

rspec_cli_options = %w[
--dry-run

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
--dry-run
--dry-run
--require
rails_helper

(or spec_helper)

print((itr.skipped_tests_count.to_f / itr.total_tests_count).floor(2))
end

task :skippable_percentage_estimate do

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
task :skippable_percentage_estimate do
task skippable_percentage_estimate: :environment do

@anmarchenko anmarchenko force-pushed the anmarchenko/rake_skippable_tests_percentage branch from 6b21d41 to c050ca4 Compare July 22, 2024 05:23
@anmarchenko anmarchenko force-pushed the anmarchenko/rake_skippable_tests_percentage branch from d411a96 to 4d8a92a Compare August 28, 2024 11:28
Datadog.logger.warn { "Intelligent test runner is not supported for forking test runners yet" }
return
end

@mutex.synchronize do
Telemetry.itr_skipped
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FIXME: this is a bug, need to be moved down to count skipped tests correctly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants