cucumber-core 19.0.0 → 20.1.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/CHANGELOG.md +21 -1
- data/README.md +1 -2
- data/lib/cucumber/core/test/no_retries.rb +11 -0
- data/lib/cucumber/core/test/result/pending.rb +13 -4
- data/lib/cucumber/core/test/result/raisable.rb +11 -1
- data/lib/cucumber/core/test/result/skipped.rb +13 -4
- data/lib/cucumber/core/test/runner.rb +9 -13
- data/lib/cucumber/core/version.rb +7 -0
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3f9931a15c76e003ac7bb598bf814bbd5d908ba256eb852847cb7aefc84dfda3
|
|
4
|
+
data.tar.gz: d3ed87cbc37e6c7c432747abb6caef55d10363bd4d75b440a27c7b856022dd6e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 55ec2c7b9356c1d61b44e7bc71ad82718bca4841da8a59e56aedca11d1709831aeffa28e38de81465e9730887bcd9fb7e94ace5625db8af771eca1812f99d5ce
|
|
7
|
+
data.tar.gz: 2cda929bc001a8ea4e0b49a39d4f0ce61faf5b7dd2fcbd29826ff95d7e6f2e40adbc229159b28293d10d0779fee2d3e7f9dd519986baa2856c817bcce5f2658c
|
data/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,24 @@ Please visit [cucumber/CONTRIBUTING.md](https://github.com/cucumber/cucumber/blo
|
|
|
10
10
|
|
|
11
11
|
## [Unreleased]
|
|
12
12
|
|
|
13
|
+
## [20.1.0] - 2026-11-02
|
|
14
|
+
### Added
|
|
15
|
+
- Moved the version definition to `lib/cucumber/core/version.rb` and updated the gemspec to use `Cucumber::Core::VERSION`
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
- Add additional parameters (`message` and `exception`), conditionally to the message generated by a pending or skipped
|
|
19
|
+
test step (If it is defined in the invocating step definition) ([#348](https://github.com/cucumber/cucumber-ruby-core/pull/348))
|
|
20
|
+
|
|
21
|
+
## [20.0.0] - 2026-10-09
|
|
22
|
+
### Changed
|
|
23
|
+
- **BREAKING CHANGE:** `Cucumber::Core::Test::Runner` now takes a retry policy instead of a maximum number of attempts, and
|
|
24
|
+
asks it whether a finished test case will be retried. Its optional constructor arguments became keyword arguments. See upgrading notes for
|
|
25
|
+
[20.0.0.md](upgrading_notes/20.0.0.md#upgrading-to-cucumber-core-2000), for full changes
|
|
26
|
+
|
|
27
|
+
### Fixed
|
|
28
|
+
- The `TestCaseFinished` envelope is now emitted before the `test_case_finished` event, so a test case retried from
|
|
29
|
+
that event no longer has its envelope emitted out of order and with the started id of the retry
|
|
30
|
+
|
|
13
31
|
## [19.0.0] - 2026-08-19
|
|
14
32
|
### Added
|
|
15
33
|
- Emit test_case_started/finished and test_step_started/test_step_finished envelopes from the Runner. ([#331](https://github.com/cucumber/cucumber-ruby-core/pull/331))
|
|
@@ -164,7 +182,9 @@ See upgrading notes for [13.0.0.md](upgrading_notes/13.0.0.md#upgrading-to-cucum
|
|
|
164
182
|
### Changed
|
|
165
183
|
- Updated `cucumber-gherkin` and `cucumber-messages`
|
|
166
184
|
|
|
167
|
-
[Unreleased]: https://github.com/cucumber/cucumber-ruby-core/compare/
|
|
185
|
+
[Unreleased]: https://github.com/cucumber/cucumber-ruby-core/compare/v20.1.0...HEAD
|
|
186
|
+
[20.1.0]: https://github.com/cucumber/cucumber-ruby-core/compare/v20.0.0...v20.1.0
|
|
187
|
+
[20.0.0]: https://github.com/cucumber/cucumber-ruby-core/compare/v19.0.0...v20.0.0
|
|
168
188
|
[19.0.0]: https://github.com/cucumber/cucumber-ruby-core/compare/v18.0.0...v19.0.0
|
|
169
189
|
[18.0.0]: https://github.com/cucumber/cucumber-ruby-core/compare/v17.0.0...v18.0.0
|
|
170
190
|
[17.0.0]: https://github.com/cucumber/cucumber-ruby-core/compare/v16.2.0...v17.0.0
|
data/README.md
CHANGED
|
@@ -5,8 +5,7 @@
|
|
|
5
5
|
[](https://vshymanskyy.github.io/StandWithUkraine)
|
|
6
6
|
[](https://opencollective.com/cucumber)
|
|
7
7
|
[](https://opencollective.com/cucumber)
|
|
8
|
-
[](https://codeclimate.com/github/cucumber/cucumber-ruby-core)
|
|
8
|
+
[](https://github.com/cucumber/cucumber-ruby-core/actions/workflows/test-ruby.yaml)
|
|
10
9
|
|
|
11
10
|
Cucumber is a tool for running automated tests written in plain language. Because they're
|
|
12
11
|
written in plain language, they can be read by anyone on your team. Because they can be
|
|
@@ -29,10 +29,19 @@ module Cucumber
|
|
|
29
29
|
end
|
|
30
30
|
|
|
31
31
|
def to_message
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
if message
|
|
33
|
+
Cucumber::Messages::TestStepResult.new(
|
|
34
|
+
status: Cucumber::Messages::TestStepResultStatus::PENDING,
|
|
35
|
+
duration: duration.to_message_duration,
|
|
36
|
+
message: message,
|
|
37
|
+
exception: exception_sub_message
|
|
38
|
+
)
|
|
39
|
+
else
|
|
40
|
+
Cucumber::Messages::TestStepResult.new(
|
|
41
|
+
status: Cucumber::Messages::TestStepResultStatus::PENDING,
|
|
42
|
+
duration: duration.to_message_duration
|
|
43
|
+
)
|
|
44
|
+
end
|
|
36
45
|
end
|
|
37
46
|
end
|
|
38
47
|
end
|
|
@@ -11,7 +11,7 @@ module Cucumber
|
|
|
11
11
|
class Raisable < StandardError
|
|
12
12
|
attr_reader :message, :duration
|
|
13
13
|
|
|
14
|
-
def initialize(message =
|
|
14
|
+
def initialize(message = nil, duration = UnknownDuration.new, backtrace = nil)
|
|
15
15
|
@message = message
|
|
16
16
|
@duration = duration
|
|
17
17
|
super(message)
|
|
@@ -39,6 +39,16 @@ module Cucumber
|
|
|
39
39
|
|
|
40
40
|
filter.new(dup).exception
|
|
41
41
|
end
|
|
42
|
+
|
|
43
|
+
private
|
|
44
|
+
|
|
45
|
+
def exception_sub_message
|
|
46
|
+
Cucumber::Messages::Exception.new(
|
|
47
|
+
type: self.class,
|
|
48
|
+
message: message,
|
|
49
|
+
stack_trace: backtrace&.join("\n")
|
|
50
|
+
)
|
|
51
|
+
end
|
|
42
52
|
end
|
|
43
53
|
end
|
|
44
54
|
end
|
|
@@ -29,10 +29,19 @@ module Cucumber
|
|
|
29
29
|
end
|
|
30
30
|
|
|
31
31
|
def to_message
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
if message
|
|
33
|
+
Cucumber::Messages::TestStepResult.new(
|
|
34
|
+
status: Cucumber::Messages::TestStepResultStatus::SKIPPED,
|
|
35
|
+
duration: duration.to_message_duration,
|
|
36
|
+
message: message,
|
|
37
|
+
exception: exception_sub_message
|
|
38
|
+
)
|
|
39
|
+
else
|
|
40
|
+
Cucumber::Messages::TestStepResult.new(
|
|
41
|
+
status: Cucumber::Messages::TestStepResultStatus::SKIPPED,
|
|
42
|
+
duration: duration.to_message_duration
|
|
43
|
+
)
|
|
44
|
+
end
|
|
36
45
|
end
|
|
37
46
|
end
|
|
38
47
|
end
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
require 'cucumber/messages/helpers/test_step_result_comparator'
|
|
4
4
|
|
|
5
|
+
require_relative 'no_retries'
|
|
5
6
|
require_relative 'timer'
|
|
6
7
|
require 'cucumber/messages'
|
|
7
8
|
|
|
@@ -14,11 +15,13 @@ module Cucumber
|
|
|
14
15
|
attr_reader :event_bus, :running_test_case, :running_test_step, :id_generator
|
|
15
16
|
private :event_bus, :running_test_case, :running_test_step, :id_generator
|
|
16
17
|
|
|
17
|
-
|
|
18
|
+
# @param retry_policy [#will_be_retried?] asked, once a test case has finished, whether it is going to be
|
|
19
|
+
# run again. It receives the test case and its result. By default, no test case is ever reported as retried.
|
|
20
|
+
def initialize(event_bus, id_generator: Cucumber::Messages::Helpers::IdGenerator::UUID.new, backtrace_filter: nil, retry_policy: NoRetries.new)
|
|
18
21
|
@event_bus = event_bus
|
|
19
22
|
@id_generator = id_generator
|
|
20
23
|
@backtrace_filter = backtrace_filter
|
|
21
|
-
@
|
|
24
|
+
@retry_policy = retry_policy
|
|
22
25
|
@current_test_case = nil
|
|
23
26
|
end
|
|
24
27
|
|
|
@@ -34,8 +37,8 @@ module Cucumber
|
|
|
34
37
|
descend.call(self)
|
|
35
38
|
|
|
36
39
|
result = calculate_test_case_result(test_case)
|
|
40
|
+
event_bus.envelope(to_test_case_finished_envelope(test_case, result))
|
|
37
41
|
event_bus.test_case_finished(test_case, result)
|
|
38
|
-
event_bus.envelope(to_test_case_finished_envelope(result))
|
|
39
42
|
self
|
|
40
43
|
end
|
|
41
44
|
|
|
@@ -82,12 +85,12 @@ module Cucumber
|
|
|
82
85
|
)
|
|
83
86
|
end
|
|
84
87
|
|
|
85
|
-
def to_test_case_finished_envelope(result)
|
|
88
|
+
def to_test_case_finished_envelope(test_case, result)
|
|
86
89
|
Cucumber::Messages::Envelope.new(
|
|
87
90
|
test_case_finished: Cucumber::Messages::TestCaseFinished.new(
|
|
88
91
|
test_case_started_id: @current_test_case_started_id,
|
|
89
92
|
timestamp: time_to_timestamp(Time.now),
|
|
90
|
-
will_be_retried:
|
|
93
|
+
will_be_retried: @retry_policy.will_be_retried?(test_case, result)
|
|
91
94
|
)
|
|
92
95
|
)
|
|
93
96
|
end
|
|
@@ -111,7 +114,7 @@ module Cucumber
|
|
|
111
114
|
result_message = Cucumber::Messages::TestStepResult.new(
|
|
112
115
|
status: result_message.status,
|
|
113
116
|
duration: result_message.duration,
|
|
114
|
-
message:
|
|
117
|
+
message: result_message.message,
|
|
115
118
|
exception: to_exception_object(result, message_element)
|
|
116
119
|
)
|
|
117
120
|
end
|
|
@@ -125,13 +128,6 @@ module Cucumber
|
|
|
125
128
|
)
|
|
126
129
|
end
|
|
127
130
|
|
|
128
|
-
def to_error_message(message_element)
|
|
129
|
-
<<~ERROR_MESSAGE
|
|
130
|
-
#{message_element.message} (#{message_element.class})
|
|
131
|
-
#{message_element.backtrace}
|
|
132
|
-
ERROR_MESSAGE
|
|
133
|
-
end
|
|
134
|
-
|
|
135
131
|
def to_exception_object(result, message_element)
|
|
136
132
|
return unless result.failed?
|
|
137
133
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cucumber-core
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 20.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Aslak Hellesøy
|
|
@@ -217,6 +217,7 @@ files:
|
|
|
217
217
|
- lib/cucumber/core/test/filters/tag_filter.rb
|
|
218
218
|
- lib/cucumber/core/test/hook_step.rb
|
|
219
219
|
- lib/cucumber/core/test/location.rb
|
|
220
|
+
- lib/cucumber/core/test/no_retries.rb
|
|
220
221
|
- lib/cucumber/core/test/result.rb
|
|
221
222
|
- lib/cucumber/core/test/result/ambiguous.rb
|
|
222
223
|
- lib/cucumber/core/test/result/boolean_methods.rb
|
|
@@ -235,6 +236,7 @@ files:
|
|
|
235
236
|
- lib/cucumber/core/test/step.rb
|
|
236
237
|
- lib/cucumber/core/test/tag.rb
|
|
237
238
|
- lib/cucumber/core/test/timer.rb
|
|
239
|
+
- lib/cucumber/core/version.rb
|
|
238
240
|
homepage: https://cucumber.io
|
|
239
241
|
licenses:
|
|
240
242
|
- MIT
|
|
@@ -262,5 +264,5 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
262
264
|
requirements: []
|
|
263
265
|
rubygems_version: 4.0.16
|
|
264
266
|
specification_version: 4
|
|
265
|
-
summary: cucumber-core-
|
|
267
|
+
summary: cucumber-core-20.1.0
|
|
266
268
|
test_files: []
|