Spec: Improve jenkins page formatters
This will allow the test result pages in jenkins to *always* show timestamps so it's clear what we mean by "oldest" and "newest." Change-Id: If7a317250eab118e961a0bc29103c86e134ce09c Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/240189 QA-Review: James Butters <jbutters@instructure.com> Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Aaron Ogata <aogata@instructure.com> Reviewed-by: James Butters <jbutters@instructure.com> Product-Review: Derek Bender <djbender@instructure.com>
This commit is contained in:
parent
e9ad048677
commit
8b25095c54
|
@ -100,9 +100,10 @@ module ErrorContext
|
|||
|
||||
def note_recent_spec_run(example)
|
||||
recent_spec_runs << {
|
||||
location: RerunArgument.for(example),
|
||||
exception: example.exception,
|
||||
pending: example.pending
|
||||
location: RerunArgument.for(example),
|
||||
pending: example.pending,
|
||||
recorded_at: Time.zone.now
|
||||
}
|
||||
self.num_failures += 1 if example.exception
|
||||
end
|
||||
|
|
|
@ -60,13 +60,14 @@ module ErrorContext
|
|||
base_path = "../" + ("../" * summary.spec_path.count("/"))
|
||||
errors = ErrorSummary.recent_spec_runs.reverse.map do |run|
|
||||
location = ERB::Util.html_escape(run[:location])
|
||||
if run[:pending]
|
||||
contents = if run[:pending]
|
||||
"bin/rspec #{location} (pending)"
|
||||
elsif run[:exception]
|
||||
"bin/rspec <a href=\"#{base_path + location}/index.html\">#{location}</a> (failed)"
|
||||
else
|
||||
"bin/rspec #{location}"
|
||||
end
|
||||
"#{run[:recorded_at]}: #{contents}"
|
||||
end.join("<br>")
|
||||
|
||||
"(newest)<br>#{errors}<br>(oldest)".html_safe
|
||||
|
|
Loading…
Reference in New Issue