From 5d32a7a175fd1a7a6c97019a022c11434ea637dc Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Fri, 3 Apr 2020 00:07:49 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- lib/gitlab/ci/reports/test_case.rb | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'lib') diff --git a/lib/gitlab/ci/reports/test_case.rb b/lib/gitlab/ci/reports/test_case.rb index d95941059ff..75898745366 100644 --- a/lib/gitlab/ci/reports/test_case.rb +++ b/lib/gitlab/ci/reports/test_case.rb @@ -12,20 +12,19 @@ module Gitlab attr_reader :name, :classname, :execution_time, :status, :file, :system_output, :stack_trace, :key, :attachment, :job - # rubocop: disable Metrics/ParameterLists - def initialize(name:, classname:, execution_time:, status:, file: nil, system_output: nil, stack_trace: nil, attachment: nil, job: nil) - @name = name - @classname = classname - @file = file - @execution_time = execution_time.to_f - @status = status - @system_output = system_output - @stack_trace = stack_trace + def initialize(params) + @name = params.fetch(:name) + @classname = params.fetch(:classname) + @file = params.fetch(:file, nil) + @execution_time = params.fetch(:execution_time).to_f + @status = params.fetch(:status) + @system_output = params.fetch(:system_output, nil) + @stack_trace = params.fetch(:stack_trace, nil) + @attachment = params.fetch(:attachment, nil) + @job = params.fetch(:job, nil) + @key = sanitize_key_name("#{classname}_#{name}") - @attachment = attachment - @job = job end - # rubocop: enable Metrics/ParameterLists def has_attachment? attachment.present? -- cgit v1.2.1