Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/formatters/json_formatter.rb')
-rw-r--r--spec/support/formatters/json_formatter.rb13
1 files changed, 9 insertions, 4 deletions
diff --git a/spec/support/formatters/json_formatter.rb b/spec/support/formatters/json_formatter.rb
index 10af5445b7a..1fb0c7c91ec 100644
--- a/spec/support/formatters/json_formatter.rb
+++ b/spec/support/formatters/json_formatter.rb
@@ -26,11 +26,15 @@ module Support
hash[:exceptions] = exceptions.map do |exception|
hash = {
class: exception.class.name,
- message: exception.message,
- message_lines: strip_ansi_codes(notification.message_lines),
- backtrace: notification.formatted_backtrace
+ message: exception.message
}
+ hash[:backtrace] = notification.formatted_backtrace if notification.respond_to?(:formatted_backtrace)
+
+ if notification.respond_to?(:message_lines)
+ hash[:message_lines] = strip_ansi_codes(notification.message_lines)
+ end
+
if loglinking
hash.merge!(
correlation_id: exception.message[match_data_after(loglinking::CORRELATION_ID_TITLE)],
@@ -74,7 +78,8 @@ module Support
product_group: example.metadata[:product_group],
feature_category: example.metadata[:feature_category],
ci_job_url: ENV['CI_JOB_URL'],
- retry_attempts: example.metadata[:retry_attempts]
+ retry_attempts: example.metadata[:retry_attempts],
+ level: example.metadata[:level]
}
end