allure-rspec 2.32.0 → 3.0.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: 7b1ea18ddb872284ccba7545c9e8b0918b75d765000498381a53a7de2f0a5472
4
- data.tar.gz: 4d47410b77295618c92416d154744c4f4c0e75449bdb386fb6e05111bce38c60
3
+ metadata.gz: c92896f3a5a87018cce60542bb0eaee341a4d43f5fa0068fb9e2a764778847d9
4
+ data.tar.gz: 28c2aeb4a79d875777170a34d54195fff23f56d07dede6cec3420184a2a4c1c9
5
5
  SHA512:
6
- metadata.gz: 999a696e41ef85ae1566aca0879e7ea7704aaf4fdf81c0166387ed5d546286afebad769fac5a2f968dae592d6088a48497d0010c3b09667638138abe6f84dd17
7
- data.tar.gz: 6546a3ff10044dfb8841f132d677071eb538ea14f0b7306be12d5c11d6dca6a85a972ae6179ac20d6a3803198f75204d011421e09453aef12f5c354575b54c21
6
+ metadata.gz: fe8542ea8a9f82e99b704fb848288121cc3f6840326e4801dd1f32dfc2447aced35cf05af51f908b3121842e267f76ce7486d8b95523c973297976a5473c1c48
7
+ data.tar.gz: 13c21d87a9f5f3ed41f4bcf88660017613b1220bac1cc3fed19fb1be840263511e510a8e9e37f3f3bb8891c4fa8ca67db58c928809656532c9da6785a4ff39ce
@@ -2,6 +2,15 @@
2
2
 
3
3
  module AllureRspec
4
4
  module Utils
5
+ # Match reported full names through RSpec's metadata filter API.
6
+ # @param [Set<String>] names
7
+ # @return [Proc]
8
+ def self.full_name_filter(names)
9
+ lambda do |file_path, metadata|
10
+ names.include?(Allure::ResultUtils.full_name(file_path, metadata[:full_description]))
11
+ end
12
+ end
13
+
5
14
  # Strip relative ./ form path
6
15
  # @param [String] path
7
16
  # @return [String]
@@ -33,8 +33,8 @@ module AllureRspec
33
33
  ids = Allure::TestPlan.test_ids
34
34
  names = Allure::TestPlan.test_names
35
35
 
36
- config.filter_run_when_matching(*ids.map { |id| { allure_id: id } }) if ids
37
- config.full_description = names if names
36
+ config.filter_run_when_matching(*ids.map { |id| { allure_id: id } }) if ids&.any?
37
+ config.filter_run_including(rerun_file_path: Utils.full_name_filter(names.to_set)) if names&.any?
38
38
  end
39
39
 
40
40
  def initialize(output)
@@ -78,7 +78,16 @@ module AllureRspec
78
78
  # @param [RSpec::Core::Notifications::ExampleNotification] example_notification
79
79
  # @return [void]
80
80
  def example_started(example_notification)
81
- lifecycle.start_test_case(test_result(example_notification.example))
81
+ example = example_notification.example
82
+ result = test_result(example)
83
+ if Allure::TestPlan.excluded?(
84
+ allure_id: example.metadata[:allure_id], selector: result.full_name, test_case_id: result.test_case_id
85
+ )
86
+ result.status_details.muted = true
87
+ example.metadata[:skip] = "Skipped by Allure test plan"
88
+ end
89
+
90
+ lifecycle.start_test_case(result)
82
91
  end
83
92
 
84
93
  # Finishes example
@@ -116,13 +125,15 @@ module AllureRspec
116
125
  # @return [Allure::TestResult]
117
126
  def test_result(example)
118
127
  parser = RspecMetadataParser.new(example, allure_config)
128
+ full_name = Allure::ResultUtils.full_name(example.metadata[:rerun_file_path], example.full_description)
119
129
 
120
130
  Allure::TestResult.new(
121
131
  name: example.description,
122
132
  description: "Location - #{strip_relative(parser.location)}",
123
133
  description_html: "Location - #{strip_relative(parser.location)}",
124
134
  history_id: example.id,
125
- full_name: example.full_description,
135
+ full_name: full_name,
136
+ test_case_id: Digest::MD5.hexdigest(full_name),
126
137
  title_path: parser.title_path,
127
138
  labels: parser.labels,
128
139
  links: parser.links,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: allure-rspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.32.0
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrejs Cunskis
@@ -15,14 +15,14 @@ dependencies:
15
15
  requirements:
16
16
  - - '='
17
17
  - !ruby/object:Gem::Version
18
- version: 2.32.0
18
+ version: 3.0.0
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - '='
24
24
  - !ruby/object:Gem::Version
25
- version: 2.32.0
25
+ version: 3.0.0
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: rspec-core
28
28
  requirement: !ruby/object:Gem::Requirement