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

Feature Request: Add Configuration Option to Disable Pending Specs as Warnings #81

Open
andrewmcodes opened this issue Nov 29, 2024 · 1 comment

Comments

@andrewmcodes
Copy link

Problem

Currently, rspec-github formats pending specs as warnings, which show up in annotations list. While this behavior can be useful in some cases, it can also be distracting when there are many pending specs or when they are intentionally not a concern. It would be helpful to have a configuration option to disable this behavior.

Proposed Solution

I have not worked with RSpec plugins/formatters before so I am not sure if this is helpful but here are some examples of how it could work based on some other gems:

Example 1 (based on VCR config)

# spec/support/config/rspec_github.rb
require "rspec/github"

RSpec::GithubFormatter.configure do |config|
  config.show_pending_as_warnings = false
end

Example 2 (based on Webmock config)

# spec/support/config/rspec_github.rb
require "rspec/github"

RSpec.configure do |config|
  config.before(:suite) do
    RSpec::GithubFormatter.show_pending_as_warnings = false
  end
end

Benefits

  • Reduce clutter in annotation list
  • Allow developers to focus on more critical failures
  • Makes the formatter work for different development workflows

Work Around

I could work around this by forking the action and modifying the code but I wanted to ask here first!

Thank you for considering!

@StefSchenkelaars
Copy link
Contributor

If I understand your problem correctly, you don't want to show pending specs in the GitHub annotations list.

This issue is also described in the usage section of the readme as you can solve this by using the RSpec filter:

rspec --format RSpec::Github::Formatter --tag ~skip

This will not run any pending specs and thus not output this to GitHub. Does this solve your problem or did I misunderstand it?

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

No branches or pull requests

2 participants