allure-report-publisher 0.5.4 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e07e63b14a3d8101f13eb9f4f824485f0c9eab83a8cc3d2dc13beb72cb3817c4
4
- data.tar.gz: 5d040670bafc783b72e803b0fc942714b4aa5a560070711389821461a9f485bf
3
+ metadata.gz: e668a0aee13c1d2edab3fee43da526050512d0566f6635116a8ab3ac36478040
4
+ data.tar.gz: 724e24dbdc7eb7a1c481c548347eed2c5e07de5f50b1e094d24a25daf37e31df
5
5
  SHA512:
6
- metadata.gz: bbbef8d211fa162cb3dc3cb170bcc6167247938f9157e28c75f0a12c2d6296e1cc8b546e5b962855a6e6944b9e31d2538153237773a794991c47a822cde2e9bb
7
- data.tar.gz: 5734ed15c3c4296394b34a05a86c48e06da2e6e12bcb044941c5624c6775a577019fe071bd4d55a01c07f56bce92e634044591ae0edfc13b5e9e21f5436ff8e2
6
+ metadata.gz: fbef301794bb94eaeb405fc8e671a474c4f71076fcebb10ad7ed913d758e08d650ee0589093e1f2c4b96efb733f342b2f4564c1c5e2b73227b00df81ca8773af
7
+ data.tar.gz: ab5c493d8b61e7e04db967b397511610747091b5f7b3aa1554a7ef9eeb0bbd01554f6c527961e1dd834bfbfe1794100113b3feea97d6c9ea1905dff055a0b6c0
@@ -32,6 +32,10 @@ module Publisher
32
32
  Publisher::Helpers::Summary::PACKAGES,
33
33
  Publisher::Helpers::Summary::TOTAL
34
34
  ]
35
+ option :collapse_summary,
36
+ type: :boolean,
37
+ default: false,
38
+ desc: "Create summary as a collapsable section"
35
39
  option :copy_latest,
36
40
  type: :boolean,
37
41
  default: false,
@@ -83,7 +87,8 @@ module Publisher
83
87
  :bucket,
84
88
  :prefix,
85
89
  :copy_latest,
86
- :update_pr
90
+ :update_pr,
91
+ :collapse_summary
87
92
  )
88
93
  )
89
94
  end
@@ -13,12 +13,14 @@ module Publisher
13
13
  # @param [String] build_name
14
14
  # @param [String] sha_url
15
15
  # @param [String] summary_type
16
- def initialize(report_url:, report_path:, build_name:, sha_url:, summary_type:)
17
- @report_url = report_url
18
- @report_path = report_path
19
- @build_name = build_name
20
- @sha_url = sha_url
21
- @summary_type = summary_type
16
+ # @param [String] collapse_summary
17
+ def initialize(**args)
18
+ @report_url = args[:report_url]
19
+ @report_path = args[:report_path]
20
+ @build_name = args[:build_name]
21
+ @sha_url = args[:sha_url]
22
+ @summary_type = args[:summary_type]
23
+ @collapse_summary = args[:collapse_summary]
22
24
  end
23
25
 
24
26
  # Matches url section pattern
@@ -59,7 +61,8 @@ module Publisher
59
61
  :report_path,
60
62
  :build_name,
61
63
  :sha_url,
62
- :summary_type
64
+ :summary_type,
65
+ :collapse_summary
63
66
 
64
67
  private
65
68
 
@@ -84,8 +87,11 @@ module Publisher
84
87
  @job_entry ||= begin
85
88
  entry = ["<!-- #{build_name} -->"]
86
89
  entry << "**#{build_name}**: #{summary.status} [test report](#{report_url}) for #{sha_url}"
90
+ entry << "<details>" if collapse_summary
91
+ entry << "<summary>expand test summary</summary>\n" if collapse_summary
87
92
  entry << "```markdown\n#{summary.table}\n```" if summary_type
88
- entry << "<!-- #{build_name} -->"
93
+ entry << "</details>" if collapse_summary
94
+ entry << "<!-- #{build_name} -->\n"
89
95
 
90
96
  entry.join("\n")
91
97
  end
@@ -95,7 +101,7 @@ module Publisher
95
101
  #
96
102
  # @return [RegExp]
97
103
  def job_entry_pattern
98
- @job_entry_pattern ||= /<!-- #{build_name} -->\n([\s\S]+)\n<!-- #{build_name} -->/
104
+ @job_entry_pattern ||= /<!-- #{build_name} -->\n([\s\S]+)\n<!-- #{build_name} -->\n/
99
105
  end
100
106
 
101
107
  # Allure report url section
@@ -19,11 +19,12 @@ module Publisher
19
19
  #
20
20
  # @param [String] report_url
21
21
  # @param [Boolean] update_pr
22
- def initialize(report_url:, report_path:, update_pr:, summary_type:)
22
+ def initialize(report_url:, report_path:, update_pr:, summary_type:, collapse_summary:)
23
23
  @report_url = report_url
24
24
  @report_path = report_path
25
25
  @update_pr = update_pr
26
26
  @summary_type = summary_type
27
+ @collapse_summary = collapse_summary
27
28
  end
28
29
 
29
30
  # :nocov:
@@ -67,7 +68,8 @@ module Publisher
67
68
  attr_reader :report_url,
68
69
  :report_path,
69
70
  :update_pr,
70
- :summary_type
71
+ :summary_type,
72
+ :collapse_summary
71
73
 
72
74
  # Current pull request description
73
75
  #
@@ -128,7 +130,8 @@ module Publisher
128
130
  report_path: report_path,
129
131
  build_name: build_name,
130
132
  sha_url: sha_url,
131
- summary_type: summary_type
133
+ summary_type: summary_type,
134
+ collapse_summary: collapse_summary
132
135
  )
133
136
  end
134
137
  end
@@ -19,13 +19,24 @@ module Publisher
19
19
  "retry-trend.json"
20
20
  ].freeze
21
21
 
22
- def initialize(results_glob:, bucket:, update_pr: nil, prefix: nil, copy_latest: false, summary_type: nil) # rubocop:disable Metrics/ParameterLists
23
- @results_glob = results_glob
24
- @bucket_name = bucket
25
- @prefix = prefix
26
- @update_pr = update_pr
27
- @summary_type = summary_type
28
- @copy_latest = !!(Providers.provider && copy_latest) # copy latest for ci only
22
+ # Uploader instance
23
+ #
24
+ # @param [Hash] args
25
+ # @option args [String] :results_glob
26
+ # @option args [String] :bucket
27
+ # @option args [String] :prefix
28
+ # @option args [Boolean] :update_pr
29
+ # @option args [String] :summary_type
30
+ # @option args [Boolean] :collapse_summary
31
+ # @option args [String] :copy_latest
32
+ def initialize(**args)
33
+ @results_glob = args[:results_glob]
34
+ @bucket_name = args[:bucket]
35
+ @prefix = args[:prefix]
36
+ @update_pr = args[:update_pr]
37
+ @summary_type = args[:summary_type]
38
+ @copy_latest = (Providers.provider && args[:copy_latest]) # copy latest for ci only
39
+ @collapse_summary = args[:collapse_summary]
29
40
  end
30
41
 
31
42
  # Execute allure report generation and upload
@@ -87,7 +98,8 @@ module Publisher
87
98
  :prefix,
88
99
  :update_pr,
89
100
  :copy_latest,
90
- :summary_type
101
+ :summary_type,
102
+ :collapse_summary
91
103
 
92
104
  def_delegators :report_generator, :results_path, :report_path
93
105
 
@@ -154,7 +166,7 @@ module Publisher
154
166
  #
155
167
  # @return [String]
156
168
  def full_prefix
157
- @full_prefix ||= [prefix, run_id].compact.yield_self do |pre|
169
+ @full_prefix ||= [prefix, run_id].compact.then do |pre|
158
170
  break if pre.empty?
159
171
 
160
172
  pre.join("/")
@@ -187,7 +199,8 @@ module Publisher
187
199
  report_url: report_url,
188
200
  report_path: report_path,
189
201
  update_pr: update_pr,
190
- summary_type: summary_type
202
+ summary_type: summary_type,
203
+ collapse_summary: collapse_summary
191
204
  )
192
205
  end
193
206
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Publisher
4
- VERSION = "0.5.4"
4
+ VERSION = "0.6.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: allure-report-publisher
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.4
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrejs Cunskis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-20 00:00:00.000000000 Z
11
+ date: 2022-04-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-s3
@@ -387,7 +387,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
387
387
  requirements:
388
388
  - - ">="
389
389
  - !ruby/object:Gem::Version
390
- version: 2.5.0
390
+ version: 2.7.0
391
391
  required_rubygems_version: !ruby/object:Gem::Requirement
392
392
  requirements:
393
393
  - - ">="