Skip to content

Commit 0bd4227

Browse files
author
David Zuckerman
committed
custom health check to verify mail password is set
added test for new mail password healthcheck removed stubbing for gpg key
1 parent 1630dea commit 0bd4227

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

config/initializers/okcomputer.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,24 @@ def check
1818
end
1919
end
2020

21+
class CustomMailerCheck < OkComputer::Check
22+
# Check that the mail password is set
23+
def check
24+
if ENV['MAIL_PASSWORD'].present?
25+
mark_message 'Environment variable MAIL_PASSWORD is set.'
26+
else
27+
mark_failure
28+
mark_message 'Environment variable MAIL_PASSWORD is not set!'
29+
end
30+
end
31+
end
32+
2133
# Ensure Alma API is working.
2234
OkComputer::Registry.register 'alma-patron-lookup', AlmaPatronCheck.new
2335

2436
# Ensure database migrations have been run.
2537
OkComputer::Registry.register 'database-migrations', OkComputer::ActiveRecordMigrationsCheck.new
2638

2739
# Ensure connectivity to the mail system.
40+
OkComputer::Registry.register 'custom-mailer', CustomMailerCheck.new
2841
OkComputer::Registry.register 'action-mailer', OkComputer::ActionMailerCheck.new

spec/request/okcomputer_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
get '/health'
1313
expect(response.parsed_body.keys).to match_array %w[
1414
action-mailer
15+
custom-mailer
1516
alma-patron-lookup
1617
default
1718
database

0 commit comments

Comments
 (0)