Skip to content

Commit 7c5282f

Browse files
committed
Skip tests tagged as document: false on doc gen
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. Aside: For our team, this reduced the amount of tests being executed during docs generation down from 195 to 37.
1 parent 81e5c56 commit 7c5282f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/tasks/docs.rake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ require 'rspec/core/rake_task'
33
desc 'Generate API request documentation from API specs'
44
RSpec::Core::RakeTask.new('docs:generate') do |t|
55
t.pattern = 'spec/acceptance/**/*_spec.rb'
6-
t.rspec_opts = ["--format RspecApiDocumentation::ApiFormatter"]
6+
t.rspec_opts = ["--format RspecApiDocumentation::ApiFormatter", "--tag ~@document:false"]
77
end
88

99
desc 'Generate API request documentation from API specs (ordered)'
1010
RSpec::Core::RakeTask.new('docs:generate:ordered') do |t|
1111
t.pattern = 'spec/acceptance/**/*_spec.rb'
12-
t.rspec_opts = ["--format RspecApiDocumentation::ApiFormatter", "--order defined"]
12+
t.rspec_opts = ["--format RspecApiDocumentation::ApiFormatter", "--tag ~@document:false", "--order defined"]
1313
end

0 commit comments

Comments
 (0)