diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-03 03:07:49 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-03 03:07:49 +0300 |
commit | 5d32a7a175fd1a7a6c97019a022c11434ea637dc (patch) | |
tree | 8741a075a83a139de103915278b87e66da6efb03 /lib | |
parent | d74fcc9b69746c4d9582299c370a95aafe2ac3ac (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/ci/reports/test_case.rb | 23 |
1 files changed, 11 insertions, 12 deletions
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? |