diff options
Diffstat (limited to 'spec/support/shared_contexts/lib')
-rw-r--r-- | spec/support/shared_contexts/lib/gitlab/sidekiq_logging/structured_logger_shared_context.rb | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/spec/support/shared_contexts/lib/gitlab/sidekiq_logging/structured_logger_shared_context.rb b/spec/support/shared_contexts/lib/gitlab/sidekiq_logging/structured_logger_shared_context.rb index 7d51c90522a..aa8bc6fa79f 100644 --- a/spec/support/shared_contexts/lib/gitlab/sidekiq_logging/structured_logger_shared_context.rb +++ b/spec/support/shared_contexts/lib/gitlab/sidekiq_logging/structured_logger_shared_context.rb @@ -18,7 +18,10 @@ RSpec.shared_context 'structured_logger' do "correlation_id" => 'cid', "error_message" => "wrong number of arguments (2 for 3)", "error_class" => "ArgumentError", - "error_backtrace" => [] + "error_backtrace" => [], + "exception.message" => "wrong number of arguments (2 for 3)", + "exception.class" => "ArgumentError", + "exception.backtrace" => [] } end @@ -28,7 +31,10 @@ RSpec.shared_context 'structured_logger' do let(:clock_thread_cputime_start) { 0.222222299 } let(:clock_thread_cputime_end) { 1.333333799 } let(:start_payload) do - job.except('error_backtrace', 'error_class', 'error_message').merge( + job.except( + 'error_message', 'error_class', 'error_backtrace', + 'exception.backtrace', 'exception.class', 'exception.message' + ).merge( 'message' => 'TestWorker JID-da883554ee4fe414012f5f42: start', 'job_status' => 'start', 'pid' => Process.pid, @@ -58,7 +64,8 @@ RSpec.shared_context 'structured_logger' do 'duration_s' => 0.0, 'completed_at' => timestamp.to_f, 'cpu_s' => 1.111112, - 'rate_limiting_gates' => [] + 'rate_limiting_gates' => [], + 'worker_id' => "process_#{Process.pid}" ) end @@ -68,7 +75,10 @@ RSpec.shared_context 'structured_logger' do 'job_status' => 'fail', 'error_class' => 'ArgumentError', 'error_message' => 'Something went wrong', - 'error_backtrace' => be_a(Array).and(be_present) + 'error_backtrace' => be_a(Array).and(be_present), + 'exception.class' => 'ArgumentError', + 'exception.message' => 'Something went wrong', + 'exception.backtrace' => be_a(Array).and(be_present) ) end |