Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Chore: pdf smoke test
Browse files Browse the repository at this point in the history
We have seen issues with tests build on circle ci
passing but pdf generation on the alpine build
failing

This PR attempts to add a rake task to test
imapct of smoke testing a Grover test before
pushing to ECR
colinbruce committed Aug 5, 2024
1 parent 25ed4bc commit de3a3e4
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docker/run
Original file line number Diff line number Diff line change
@@ -11,5 +11,7 @@ bundle exec rails db:prepare db:seed
# Remove irb prompts from rails console
echo 'IRB.conf[:USE_AUTOCOMPLETE] = false' >> ~/.irbrc

bundle exec rake smoke_test:pdf

# Start the Puma server
bundle exec puma -C config/puma.rb
9 changes: 9 additions & 0 deletions lib/tasks/smoke_test.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace :smoke_test do
desc "Tries to generate a grover document"
task pdf: :environment do
Timeout.timeout(10) { Grover.new("test").to_pdf.size }
Rails.logger.info "PDF generation succeeded"
rescue Timeout::Error
raise StandardError, "PDF generation failed"
end
end

0 comments on commit de3a3e4

Please sign in to comment.