allure-report-publisher 1.6.0 → 1.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8a1b01fffd526add66fad90f0b9361fbb267cbe0245f466b2593a0dd763491f9
|
4
|
+
data.tar.gz: c906896082cb17fc3bc79b2cfcf5725d01694a927dcd5b882403777c9d14d809
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de9f9cb4037366f792d9a82c4390f4f749c212a740a515c2352ea10fecc1c566af47af6968d0717e9a1fd07281c9a6263bbd45be37b034367c3d5fa3b84b6172
|
7
|
+
data.tar.gz: 3731415da0b98f0de6667dbea3ae80898b3b68e9b49d521132605b8dece4126c15ce754495d117fe26e3d72a04f3f95a886824d0af9314859db4f29b74f16751
|
@@ -58,7 +58,7 @@ module Publisher
|
|
58
58
|
)
|
59
59
|
end
|
60
60
|
|
61
|
-
# rubocop:disable Metrics/
|
61
|
+
# rubocop:disable Metrics/PerceivedComplexity
|
62
62
|
# Add comment with report url
|
63
63
|
#
|
64
64
|
# @return [void]
|
@@ -79,13 +79,21 @@ module Publisher
|
|
79
79
|
|
80
80
|
@discussion = nil
|
81
81
|
|
82
|
-
if unresolved_discussion_on_failure &&
|
82
|
+
if unresolved_discussion_on_failure && report_has_failures? && !alert_comment
|
83
83
|
client.create_merge_request_discussion_note(project, mr_iid, discussion.id, body: alert_comment_text)
|
84
|
-
elsif alert_comment
|
84
|
+
elsif alert_comment && !report_has_failures?
|
85
85
|
client.delete_merge_request_discussion_note(project, mr_iid, discussion.id, alert_comment.id)
|
86
86
|
end
|
87
87
|
end
|
88
|
-
|
88
|
+
|
89
|
+
# Check if allure report has failures
|
90
|
+
#
|
91
|
+
# @return [Boolean]
|
92
|
+
def report_has_failures?
|
93
|
+
main_comment&.body&.include?("❌")
|
94
|
+
end
|
95
|
+
|
96
|
+
# rubocop:enable Metrics/PerceivedComplexity
|
89
97
|
|
90
98
|
# Existing discussion that has comment with allure urls
|
91
99
|
#
|
@@ -99,7 +99,7 @@ module Publisher
|
|
99
99
|
copy_source: "/#{bucket_name}/#{key(full_prefix, file.relative_path_from(report_path))}",
|
100
100
|
key: key(prefix, file.relative_path_from(report_path)),
|
101
101
|
metadata_directive: "REPLACE",
|
102
|
-
content_type:
|
102
|
+
content_type: content_type(file),
|
103
103
|
cache_control: "max-age=60"
|
104
104
|
}
|
105
105
|
end
|
@@ -143,6 +143,18 @@ module Publisher
|
|
143
143
|
def url(path_prefix)
|
144
144
|
[base_url || "http://#{bucket_name}.s3.amazonaws.com", path_prefix, "index.html"].compact.join("/")
|
145
145
|
end
|
146
|
+
|
147
|
+
# Get file content type
|
148
|
+
#
|
149
|
+
# @param [Pathname] file
|
150
|
+
# @return [String]
|
151
|
+
def content_type(file)
|
152
|
+
c_type = MiniMime.lookup_by_filename(file)&.content_type
|
153
|
+
return c_type if c_type
|
154
|
+
|
155
|
+
log_debug("Content type for '#{file}' not found, using default 'application/octet-stream'")
|
156
|
+
"application/octet-stream"
|
157
|
+
end
|
146
158
|
end
|
147
159
|
end
|
148
160
|
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: 1.6.
|
4
|
+
version: 1.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: 2023-
|
11
|
+
date: 2023-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-s3
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: 1.93.1
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 1.
|
22
|
+
version: 1.124.0
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,7 +29,7 @@ dependencies:
|
|
29
29
|
version: 1.93.1
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: 1.
|
32
|
+
version: 1.124.0
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: dry-cli
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|