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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b2b10c9286500f94660d0583cc9aeaa2a1ba2ffc0bbddf76d2f210709e36ffcd
4
- data.tar.gz: 9ab116dd4d4f2d0698adcbf80b2f4c5cf0b339435b965121c8cca1aa4d081d1c
3
+ metadata.gz: cbc236368c7b0893b5de931e7ecd37836c72bc540a5909efcf319fd74348541a
4
+ data.tar.gz: bf74a63cf06f76bc27d52cdf16fce99006a82076c12fce25de89375a27a932c0
5
5
  SHA512:
6
- metadata.gz: 8d0206593844b02dc18b72f8e835e71ea0b6864c647ce4a9c7dc249c58ab6d16129fe3cbd31b8dd6e3c3e596693f1947cee1643ff70d48b14fdb5434cdcb62d3
7
- data.tar.gz: ea0c81164c7a93d9451e9325ec1c6a14b220d7305814bbfbfbece77cb59a9c14635343ae11d92f7b1cc3b035e470eb929ab2e982002199aafb399c189c2427c8
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 # Allure results files glob. Required: true
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-result/**/*' --bucket=my-bucket
60
- allure-report-publisher upload gcs --results-glob='path/to/allure-result/**/*' --bucket=my-bucket --prefix=my-project/prs
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: "Allure results files glob. Required: true"
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-result/**/*' --bucket=my-bucket",
61
- "gcs --results-glob='path/to/allure-result/**/*' --bucket=my-bucket --prefix=my-project/prs"
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
- # Aggregated results directory
24
+ # Common path for history and executor info
26
25
  #
27
26
  # @return [String]
28
- def results_path
29
- @results_path ||= Dir.mktmpdir("allure-results")
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
- # Copy all results files to results directory
42
+ # Return all allure results paths from glob
44
43
  #
45
- # @return [void]
46
- def aggregate_results
47
- results = Dir.glob(results_glob)
48
- raise(NoAllureResultsError, "Missing allure results") if results.empty?
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
- FileUtils.cp(results, results_path)
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} #{results_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, :results_path, :report_path
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("#{results_path}/#{EXECUTOR_JSON}", ci_provider.executor_info.to_json)
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(results_path, "history"))
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(results_path, "history", file_name))
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(results_path, "history", file),
52
+ response_target: path(common_info_path, "history", file),
53
53
  key: key(prefix, "history", file),
54
54
  bucket: bucket_name
55
55
  )
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Publisher
4
- VERSION = "0.11.0"
4
+ VERSION = "1.0.0"
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.11.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-17 00:00:00.000000000 Z
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