mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 23:24:41 +08:00
DEV: Display better output when inspecting service steps
This patch aims to improve the steps inspector output: - The service class name is displayed at the top. - Next to each step is displayed the time it took to run said step. - Steps that didn’t run are hidden. - `#inspect` automatically outputs the error when it is present.
This commit is contained in:

committed by
Loïc Guitaut

parent
3ca7c5e438
commit
a589b48f9a
@ -114,7 +114,7 @@ Fabricator(:chat_message_with_service, class_name: "Chat::CreateMessage") do
|
||||
if result.failure?
|
||||
raise RSpec::Expectations::ExpectationNotMetError.new(
|
||||
"Service `#{resolved_class}` failed, see below for step details:\n\n" +
|
||||
result.inspect_steps.inspect,
|
||||
result.inspect_steps,
|
||||
)
|
||||
end
|
||||
|
||||
|
@ -47,7 +47,7 @@ module ChatSystemHelpers
|
||||
},
|
||||
)
|
||||
|
||||
raise "#{creator.inspect_steps.inspect}\n\n#{creator.inspect_steps.error}" if creator.failure?
|
||||
raise creator.inspect_steps if creator.failure?
|
||||
last_message = creator.message_instance
|
||||
end
|
||||
|
||||
@ -64,7 +64,7 @@ end
|
||||
module ChatSpecHelpers
|
||||
def service_failed!(result)
|
||||
raise RSpec::Expectations::ExpectationNotMetError.new(
|
||||
"Service failed, see below for step details:\n\n" + result.inspect_steps.inspect,
|
||||
"Service failed, see below for step details:\n\n" + result.inspect_steps,
|
||||
)
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user