Skip to content

Conversation

@timlandolt
Copy link

When a check times out or raises an error, the make_sure message can't be displayed. Also, there's no way to add some kind of message to expects. While searching for a solution, I came up with the idea of a check description.
The newly added check description enables you to set a custom description (including formatting) to a check that will be shown no matter the result of the checks/expects.

image
Darkmode image
# config/allgood.rb

check "DB Connection", description: "Testing the db connection.<br> <b>Wow, I'm bold</b>" do
  make_sure ActiveRecord::Base.connection.connect!.active?, "I will be shown because all went well"
end

check "DB Connection", description: "This messages will be shown" do
  # raise error
  make_sure 1 > "1", "This message won't be shown"
end

check "DB Connection", description: "This messages will be shown" do
  sleep 20 # force a timeout
  make_sure ActiveRecord::Base.connection.connect!.active?, "This message won't be shown"
end

# No description box will be shown

check "DB Connection", description: "" do
  make_sure ActiveRecord::Base.connection.connect!.active?
end

check "DB Connection" do
  make_sure ActiveRecord::Base.connection.connect!.active?
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant