Skip to content

Commit

Permalink
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
  • Loading branch information
colinbruce committed Aug 2, 2024
1 parent 25ed4bc commit eaba406
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions bin/sidekiq_health_check
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
module Worker
def self.healthcheck
abort 'sidekiq not found' unless system('pgrep -f sidekiq')
system('rake smoke_test:pdf')
rescue StandardError
abort 'PDF generation failed'
end
end

Expand Down
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 eaba406

Please sign in to comment.