allure-rspec 2.31.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 +4 -4
- data/lib/allure_rspec/_utils.rb +9 -0
- data/lib/allure_rspec/formatter.rb +15 -4
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c92896f3a5a87018cce60542bb0eaee341a4d43f5fa0068fb9e2a764778847d9
|
|
4
|
+
data.tar.gz: 28c2aeb4a79d875777170a34d54195fff23f56d07dede6cec3420184a2a4c1c9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fe8542ea8a9f82e99b704fb848288121cc3f6840326e4801dd1f32dfc2447aced35cf05af51f908b3121842e267f76ce7486d8b95523c973297976a5473c1c48
|
|
7
|
+
data.tar.gz: 13c21d87a9f5f3ed41f4bcf88660017613b1220bac1cc3fed19fb1be840263511e510a8e9e37f3f3bb8891c4fa8ca67db58c928809656532c9da6785a4ff39ce
|
data/lib/allure_rspec/_utils.rb
CHANGED
|
@@ -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.
|
|
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
|
-
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
25
|
+
version: 3.0.0
|
|
26
26
|
- !ruby/object:Gem::Dependency
|
|
27
27
|
name: rspec-core
|
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|