allure-report-publisher 0.11.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/lib/allure_report_publisher/commands/upload.rb +3 -3
- data/lib/allure_report_publisher/lib/report_generator.rb +12 -11
- data/lib/allure_report_publisher/lib/uploaders/_uploader.rb +3 -3
- data/lib/allure_report_publisher/lib/uploaders/gcs.rb +1 -1
- data/lib/allure_report_publisher/lib/uploaders/s3.rb +1 -1
- data/lib/allure_report_publisher/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cbc236368c7b0893b5de931e7ecd37836c72bc540a5909efcf319fd74348541a
|
4
|
+
data.tar.gz: bf74a63cf06f76bc27d52cdf16fce99006a82076c12fce25de89375a27a932c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51104eb7d7073e3495804534aaa0f415cec9f9300dd1c0fa8e1338b065acae290f91fd758c61e0af45f34165f1710923bd6a6e0f2b6d1a9c4d295d409fa89909
|
7
|
+
data.tar.gz: 5aec20910db4609549224a161a09502a390be539a77873b2d1de556b73d307b23d93d0d0f6c8404897569c7fc84e4a7c366bb33cfb6dc40406c530f1874cd2c6
|
data/README.md
CHANGED
@@ -43,7 +43,7 @@ Arguments:
|
|
43
43
|
TYPE # REQUIRED Cloud storage type: (s3/gcs)
|
44
44
|
|
45
45
|
Options:
|
46
|
-
--results-glob=VALUE #
|
46
|
+
--results-glob=VALUE # Glob pattern to return allure results directories. Required: true
|
47
47
|
--bucket=VALUE # Bucket name. Required: true
|
48
48
|
--prefix=VALUE # Optional prefix for report path. Required: false
|
49
49
|
--update-pr=VALUE # Add report url to PR via comment or description update. Required: false: (comment/description/actions)
|
@@ -56,8 +56,8 @@ Options:
|
|
56
56
|
--help, -h # Print this help
|
57
57
|
|
58
58
|
Examples:
|
59
|
-
allure-report-publisher upload s3 --results-glob='path/to/allure-
|
60
|
-
allure-report-publisher upload gcs --results-glob='
|
59
|
+
allure-report-publisher upload s3 --results-glob='path/to/allure-results' --bucket=my-bucket
|
60
|
+
allure-report-publisher upload gcs --results-glob='paths/to/**/allure-results' --bucket=my-bucket --prefix=my-project/prs
|
61
61
|
```
|
62
62
|
|
63
63
|
# Storage providers
|
@@ -14,7 +14,7 @@ module Publisher
|
|
14
14
|
desc: "Cloud storage type"
|
15
15
|
|
16
16
|
option :results_glob,
|
17
|
-
desc: "
|
17
|
+
desc: "Glob pattern to return allure results directories. Required: true"
|
18
18
|
option :bucket,
|
19
19
|
desc: "Bucket name. Required: true"
|
20
20
|
option :prefix,
|
@@ -57,8 +57,8 @@ module Publisher
|
|
57
57
|
desc: "Ignore missing allure results"
|
58
58
|
|
59
59
|
example [
|
60
|
-
"s3 --results-glob='path/to/allure-
|
61
|
-
"gcs --results-glob='
|
60
|
+
"s3 --results-glob='path/to/allure-results' --bucket=my-bucket",
|
61
|
+
"gcs --results-glob='paths/to/**/allure-results' --bucket=my-bucket --prefix=my-project/prs"
|
62
62
|
]
|
63
63
|
|
64
64
|
def call(**args)
|
@@ -18,15 +18,14 @@ module Publisher
|
|
18
18
|
#
|
19
19
|
# @return [void]
|
20
20
|
def generate
|
21
|
-
aggregate_results
|
22
21
|
generate_report
|
23
22
|
end
|
24
23
|
|
25
|
-
#
|
24
|
+
# Common path for history and executor info
|
26
25
|
#
|
27
26
|
# @return [String]
|
28
|
-
def
|
29
|
-
@
|
27
|
+
def common_info_path
|
28
|
+
@common_info_path ||= Dir.mktmpdir("allure-results")
|
30
29
|
end
|
31
30
|
|
32
31
|
# Allure report directory
|
@@ -40,14 +39,16 @@ module Publisher
|
|
40
39
|
|
41
40
|
attr_reader :results_glob
|
42
41
|
|
43
|
-
#
|
42
|
+
# Return all allure results paths from glob
|
44
43
|
#
|
45
|
-
# @return [
|
46
|
-
def
|
47
|
-
|
48
|
-
|
44
|
+
# @return [String]
|
45
|
+
def result_paths
|
46
|
+
@result_paths ||= begin
|
47
|
+
paths = Dir.glob(results_glob)
|
48
|
+
raise(NoAllureResultsError, "Missing allure results") if paths.empty?
|
49
49
|
|
50
|
-
|
50
|
+
paths.join(" ")
|
51
|
+
end
|
51
52
|
end
|
52
53
|
|
53
54
|
# Generate allure report
|
@@ -55,7 +56,7 @@ module Publisher
|
|
55
56
|
# @return [void]
|
56
57
|
def generate_report
|
57
58
|
out, _err, status = Open3.capture3(
|
58
|
-
"allure generate --clean --output #{report_path} #{
|
59
|
+
"allure generate --clean --output #{report_path} #{common_info_path} #{result_paths}"
|
59
60
|
)
|
60
61
|
raise(AllureError, out) unless status.success?
|
61
62
|
end
|
@@ -104,7 +104,7 @@ module Publisher
|
|
104
104
|
:collapse_summary,
|
105
105
|
:summary_table_type
|
106
106
|
|
107
|
-
def_delegators :report_generator, :
|
107
|
+
def_delegators :report_generator, :common_info_path, :report_path
|
108
108
|
|
109
109
|
# :nocov:
|
110
110
|
|
@@ -224,7 +224,7 @@ module Publisher
|
|
224
224
|
def add_executor_info
|
225
225
|
return unless ci_provider
|
226
226
|
|
227
|
-
File.write("#{
|
227
|
+
File.write("#{common_info_path}/#{EXECUTOR_JSON}", ci_provider.executor_info.to_json)
|
228
228
|
end
|
229
229
|
|
230
230
|
# Run upload commands
|
@@ -240,7 +240,7 @@ module Publisher
|
|
240
240
|
#
|
241
241
|
# @return [void]
|
242
242
|
def create_history_dir
|
243
|
-
FileUtils.mkdir_p(path(
|
243
|
+
FileUtils.mkdir_p(path(common_info_path, "history"))
|
244
244
|
end
|
245
245
|
end
|
246
246
|
end
|
@@ -43,7 +43,7 @@ module Publisher
|
|
43
43
|
file = bucket.file(key(prefix, "history", file_name))
|
44
44
|
raise(HistoryNotFoundError, "Allure history from previous runs not found!") unless file
|
45
45
|
|
46
|
-
file.download(path(
|
46
|
+
file.download(path(common_info_path, "history", file_name))
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
@@ -49,7 +49,7 @@ module Publisher
|
|
49
49
|
def download_history
|
50
50
|
HISTORY.each do |file|
|
51
51
|
client.get_object(
|
52
|
-
response_target: path(
|
52
|
+
response_target: path(common_info_path, "history", file),
|
53
53
|
key: key(prefix, "history", file),
|
54
54
|
bucket: bucket_name
|
55
55
|
)
|
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.
|
4
|
+
version: 1.0.0
|
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-09-
|
11
|
+
date: 2022-09-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-s3
|