allure-ruby-commons 2.10.0.beta3 → 2.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cabe6f5bc2c95461cfc64b0e394c73d3f3154dfda6f205fc09b5de9072a99bae
4
- data.tar.gz: 82c3515e7571f061029982351f221d14910ba25fd613f380107331bd3f04c2fe
3
+ metadata.gz: f87a04ab08ca894c406ea456552a64243acc4b91beb359e4c4673efc27c5b2e4
4
+ data.tar.gz: ce8af253d321e87a8115afb86df0e5d882555469de95969abac529c2b7b4c8c3
5
5
  SHA512:
6
- metadata.gz: 427009e13aad7950cae2a688a9e6e6fa2f5d0d92d632644b5d2ea984e37748e3e472196371e889d5e2504a68fc541becc0a1c7ff9d4a5b31dc77ebe6bae2889e
7
- data.tar.gz: 2b35e2c90e93115bb8e6f235e90e33c5efa5369f3302d63239af7de1fcf878f25684028890bb5a4641a9c04ef63b35595f5ef03958b926d0f37d2da05c7f6822
6
+ metadata.gz: dd99f1bb1d1d4fd31d0a3bdd91a4752f2105f17149e73a3c2b031a03741eab5483557b50bb45e7af52e016620390fe820866937605724587baa15f0d1a4a61b4
7
+ data.tar.gz: 063dc9cd0a43cfa264396d7c21b26d2080233fb8d89eba446602c51243af305774c99b9e0553d3f6f51c483d35f8bfb1ad3ae7ff7ad3463f0820e20d11c53150
data/README.md CHANGED
@@ -19,6 +19,7 @@ Following configuration options are supported:
19
19
  ```ruby
20
20
  Allure.configure do |c|
21
21
  c.results_directory = "/whatever/you/like"
22
+ c.clean_results_directory = true
22
23
  c.logging_level = Logger::INFO
23
24
  # these are used for creating links to bugs or test cases where {} is replaced with keys of relevant items
24
25
  c.link_tms_pattern = "http://www.jira.com/browse/{}"
@@ -43,6 +44,7 @@ Additional methods in [Allure](lib/allure-ruby-commons.rb) exist to add various
43
44
 
44
45
  ```ruby
45
46
  Allure.add_attachment(name: "attachment", source: "Some string", type: Allure::ContentType::TXT, test_case: false)
47
+ Allure.add_attachment(name: "attachment", source: "/path/to/test.txt", type: Allure::ContentType::TXT, test_case: false)
46
48
  Allure.add_link(name: "Custom Url", url: "http://www.github.com")
47
49
  ```
48
50
 
@@ -131,7 +131,7 @@ module Allure
131
131
  # Add attachment to current test case or step
132
132
  # @param [String] name Attachment name
133
133
  # @param [File, String] source File or string to save as attachment
134
- # @param [String] type attachment type defined in {Allure::ContentType}
134
+ # @param [String] type attachment type defined in {Allure::ContentType} or any other valid mime type
135
135
  # @param [Boolean] test_case add attachment to current test case instead of test step
136
136
  # @return [void]
137
137
  def add_attachment(name:, source:, type:, test_case: false)
@@ -163,6 +163,8 @@ module Allure
163
163
  yield(@current_fixture)
164
164
  end
165
165
 
166
+ # Stop current test fixture
167
+ # @return [void]
166
168
  def stop_fixture
167
169
  return logger.error("Could not stop fixture, fixture is not started") unless @current_fixture
168
170
 
@@ -175,7 +177,7 @@ module Allure
175
177
  # Add attachment to current test or step
176
178
  # @param [String] name Attachment name
177
179
  # @param [File, String] source File or string to save as attachment
178
- # @param [String] type attachment type defined in {Allure::ContentType}
180
+ # @param [String] type attachment type defined in {Allure::ContentType} or any other valid mime type
179
181
  # @param [Boolean] test_case add attachment to current test case
180
182
  # @return [void]
181
183
  def add_attachment(name:, source:, type:, test_case: false)
@@ -3,12 +3,15 @@
3
3
  require "logger"
4
4
 
5
5
  module Allure
6
+ # Allure configuration class
6
7
  class Config
8
+ # @return [String] default allure results directory
7
9
  DEFAULT_RESULTS_DIRECTORY = "reports/allure-results"
10
+ # @return [String] default loggin level
8
11
  DEFAULT_LOGGING_LEVEL = Logger::INFO
9
12
 
10
13
  class << self
11
- attr_accessor :link_tms_pattern, :link_issue_pattern
14
+ attr_accessor :link_tms_pattern, :link_issue_pattern, :clean_results_directory
12
15
  attr_writer :results_directory, :logging_level
13
16
 
14
17
  def results_directory
@@ -1,9 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Allure
4
+ # Allure result file writer
4
5
  class FileWriter
6
+ # @return [String] test result suffix
5
7
  TEST_RESULT_SUFFIX = "-result.json"
8
+ # @return [String] test result container suffix
6
9
  TEST_RESULT_CONTAINER_SUFFIX = "-container.json"
10
+ # @return [String] attachment file suffix
7
11
  ATTACHMENT_FILE_SUFFIX = "-attachment"
8
12
 
9
13
  # Write test result
@@ -3,6 +3,7 @@
3
3
  require_relative "jsonable"
4
4
 
5
5
  module Allure
6
+ # Allure model attachment object
6
7
  class Attachment < JSONable
7
8
  # @param [String] name attachment name
8
9
  # @param [String] type attachment type, {Allure::ContentType}
@@ -1,6 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "mime/types"
4
+
3
5
  module Allure
6
+ # Commonly used mime type definitions
4
7
  class ContentType
5
8
  TXT = "text/plain"
6
9
  XML = "application/xml"
@@ -14,8 +17,11 @@ module Allure
14
17
  WEBM = "video/webm"
15
18
  JPG = "image/jpeg"
16
19
 
20
+ # Get file extension from mime type
21
+ # @param [String] content_type mime type
22
+ # @return [String] file extension
17
23
  def self.to_extension(content_type)
18
- constants.detect { |const| const_get(const) == content_type }&.to_s&.downcase
24
+ MIME::Types[content_type]&.first&.preferred_extension
19
25
  end
20
26
  end
21
27
  end
@@ -3,6 +3,7 @@
3
3
  require_relative "jsonable"
4
4
 
5
5
  module Allure
6
+ # Allure model executable item
6
7
  class ExecutableItem < JSONable
7
8
  # @param [Hash] options
8
9
  # @option options [String] :name
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Allure
4
+ # Allure model fixture result
4
5
  class FixtureResult < ExecutableItem; end
5
6
  end
@@ -3,6 +3,7 @@
3
3
  require "json"
4
4
 
5
5
  module Allure
6
+ # General jsonable object implementation
6
7
  class JSONable
7
8
  def as_json(_options = {})
8
9
  instance_variables.each_with_object({}) do |var, map|
@@ -3,6 +3,7 @@
3
3
  require_relative "jsonable"
4
4
 
5
5
  module Allure
6
+ # Allure model label object
6
7
  class Label < JSONable
7
8
  def initialize(name, value)
8
9
  @name = name
@@ -3,6 +3,7 @@
3
3
  require_relative "jsonable"
4
4
 
5
5
  module Allure
6
+ # Allure model link object
6
7
  class Link < JSONable
7
8
  def initialize(type, name, url)
8
9
  @type = type
@@ -3,6 +3,7 @@
3
3
  require_relative "jsonable"
4
4
 
5
5
  module Allure
6
+ # Allure model parameter object
6
7
  class Parameter < JSONable
7
8
  def initialize(name, value)
8
9
  @name = name
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Allure
4
+ # Allure stages
4
5
  class Stage
5
6
  SCHEDULED = "scheduled"
6
7
  RUNNING = "running"
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Allure
4
+ # Allure model statuses
4
5
  class Status
5
6
  FAILED = :failed
6
7
  BROKEN = :broken
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Allure
4
+ # Allure model status detail object
4
5
  class StatusDetails < JSONable
5
6
  # @param [Boolean] known
6
7
  # @param [Boolean] muted
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Allure
4
+ # Allure model step result object
4
5
  class StepResult < ExecutableItem; end
5
6
  end
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Allure
4
+ # Allure model test result container
4
5
  class TestResult < ExecutableItem
5
6
  # @param [String] uuid
6
7
  # @param [String] history_id
@@ -2,6 +2,7 @@
2
2
 
3
3
  require_relative "jsonable"
4
4
  module Allure
5
+ # Allure model step result container
5
6
  class TestResultContainer < JSONable
6
7
  def initialize(uuid: UUID.generate, name: "Unnamed")
7
8
  @uuid = uuid
@@ -3,6 +3,7 @@
3
3
  require "socket"
4
4
 
5
5
  module Allure
6
+ # Variouse helper methods
6
7
  module ResultUtils
7
8
  ISSUE_LINK_TYPE = "issue"
8
9
  TMS_LINK_TYPE = "tms"
@@ -5,8 +5,11 @@ require "zip"
5
5
  require "pathname"
6
6
 
7
7
  module Allure
8
+ # Utility for downloading allure commandline binary
8
9
  class Util
9
- ALLURE_CLI_VERSION = "2.10.0"
10
+ # @return [String] CLI version
11
+ ALLURE_CLI_VERSION = "2.12.1"
12
+ # @return [String] CLI bin download url
10
13
  ALLURE_BIN_URL = "http://repo.maven.apache.org/maven2/io/qameta/allure/allure-commandline/"\
11
14
  "#{ALLURE_CLI_VERSION}/allure-commandline-#{ALLURE_CLI_VERSION}.zip"
12
15
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: allure-ruby-commons
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.10.0.beta3
4
+ version: 2.13.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: 2019-06-25 00:00:00.000000000 Z
11
+ date: 2019-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: uuid
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 2.3.9
19
+ version: '2.3'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 2.3.9
26
+ version: '2.3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: require_all
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -72,6 +72,20 @@ dependencies:
72
72
  - - "~>"
73
73
  - !ruby/object:Gem::Version
74
74
  version: '1.2'
75
+ - !ruby/object:Gem::Dependency
76
+ name: mime-types
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: '3.3'
82
+ type: :runtime
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - "~>"
87
+ - !ruby/object:Gem::Version
88
+ version: '3.3'
75
89
  description: Utilities allowing to implement allure result generation by other test
76
90
  frameworks
77
91
  email: andrejs.cunskis@gmail.com
@@ -100,7 +114,7 @@ files:
100
114
  - lib/allure_ruby_commons/model/test_result_container.rb
101
115
  - lib/allure_ruby_commons/result_utils.rb
102
116
  - lib/allure_ruby_commons/util.rb
103
- homepage: http://allure.qatools.ru
117
+ homepage: https://github.com/allure-framework/allure-ruby
104
118
  licenses:
105
119
  - Apache-2.0
106
120
  metadata: {}
@@ -115,9 +129,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
115
129
  version: 2.5.0
116
130
  required_rubygems_version: !ruby/object:Gem::Requirement
117
131
  requirements:
118
- - - ">"
132
+ - - ">="
119
133
  - !ruby/object:Gem::Version
120
- version: 1.3.1
134
+ version: '0'
121
135
  requirements: []
122
136
  rubygems_version: 3.0.3
123
137
  signing_key: