Skip tests tagged as document: false on docs generation
When running the below command to re-generate API docs:
RAILS_ENV=test rake docs:generate
it will execute every single rspec test under 'spec/acceptance/**/*_spec.rb'. It even executes the tests that are explicitly marked as:
document: false
With this update, only the rspec tests that contribute to the generation of API documentation will be executed by default, which is much more efficient.
Aside: For our team, this reduced the amount of tests being executed during docs generation down from 195 to 37.
Further notes Relevant RSpec documentation: https://relishapp.com/rspec/rspec-core/docs/command-line/tag-option#exclude-examples-with-a-%60name:value%60-tag-and-@
@stwr667 not sure we want to change this behavior, since I am think the intention was to use the task to both confirm all specs pass and generate docs simultaneously. I think there are a couple paths to go here:
- add a flag to trigger skipping undocumented specs,
- add another rake task,
- let users continue to add their own rake tasks when they want customization and add this as an example to the docs.
I agree with @jakehow, I don't think we want the default to be skipping tests in acceptance as the goal was "if the tests pass you get docs".
I like any of the three ways mentioned for going forward.
@jakehow, @oestrich, thanks for your feedback. I've gone with option 2.
Hi @jakehow, @oestrich, Is there anything else blocking this from going ahead? We've been using this heavily on our generations, and it's been working well. Regards, Steve
@jakehow, @oestrich, can I get some feedback on this one please? It'd be good to prevent it from getting in a stale state.
Happy new year @jakehow, @oestrich. I made changes as requested. Is there anything else holding this up from being merged?