rspec_trunk_flaky_tests 0.16.1.pre.beta.1-aarch64-linux-gnu → 0.16.2.pre.beta.3-aarch64-linux-gnu
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/rspec_trunk_flaky_tests/3.1/rspec_trunk_flaky_tests.so +0 -0
- data/lib/rspec_trunk_flaky_tests/3.2/rspec_trunk_flaky_tests.so +0 -0
- data/lib/rspec_trunk_flaky_tests/3.3/rspec_trunk_flaky_tests.so +0 -0
- data/lib/rspec_trunk_flaky_tests/3.4/rspec_trunk_flaky_tests.so +0 -0
- data/lib/rspec_trunk_flaky_tests/4.0/rspec_trunk_flaky_tests.so +0 -0
- data/lib/trunk_spec_helper.rb +66 -3
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3a547c0fe5f732720a1c612c9380f35acc5768e2bce8af8eb67ea66c8844b329
|
|
4
|
+
data.tar.gz: 6a1d7fc1b3c3a37d42f548ec4ad1c45bc5e4c81ab45565abed76ffc5f6724706
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8373ebc44e59346de4f31d29d05b0b4a2763529efc7b2ddfee808337cb5b9b9b44b77e2227957836b2d006868adb6beab7dcd3c0b67c85bcd1ef491dc425e7dc
|
|
7
|
+
data.tar.gz: 01236db145271047de1343ce41e5914081876b60262c3f0b0ac2dff50148634cba7a412abefad09e2779ccb7974d2988dc4f207e0812188b0853102708a65f52
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
data/lib/trunk_spec_helper.rb
CHANGED
|
@@ -41,6 +41,7 @@ module RSpec
|
|
|
41
41
|
# Trunk holds everything this gem defines (the native extension defines the
|
|
42
42
|
# module and its classes: TestReport, Status, CIInfo, ...). Nothing is added to
|
|
43
43
|
# the global namespace or to core classes; test/namespace_spec.rb enforces that.
|
|
44
|
+
# trunk-ignore(rubocop/Metrics/ModuleLength)
|
|
44
45
|
module Trunk
|
|
45
46
|
ANSI_ESCAPE_PATTERN = %r{(?:\e[@-Z\\-_]|\e\[[0-?]*[ -/]*[@-~])}
|
|
46
47
|
|
|
@@ -138,9 +139,71 @@ module RSpec
|
|
|
138
139
|
end
|
|
139
140
|
|
|
140
141
|
def parent_name(example)
|
|
141
|
-
name = example.example_group.metadata
|
|
142
|
+
name = description(example.example_group.metadata)
|
|
142
143
|
name.empty? ? 'rspec' : name
|
|
143
144
|
end
|
|
145
|
+
|
|
146
|
+
# The example's full_description, rebuilt with .description at every level.
|
|
147
|
+
def full_description(example)
|
|
148
|
+
group = group_full_description(example.example_group.metadata)
|
|
149
|
+
own = description(example.metadata)
|
|
150
|
+
group.empty? ? own : "#{group} #{own}"
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
# RSpec's metadata[:description], rebuilt from metadata[:description_args].
|
|
154
|
+
# RSpec turns those args into text with #to_s, which for an object without its
|
|
155
|
+
# own #to_s, or an anonymous class, includes its memory address. That gives the
|
|
156
|
+
# test a new name, and so a new id, on every run. Those args are named by class
|
|
157
|
+
# instead. Generated descriptions (`it { is_expected.to ... }`) have no args and
|
|
158
|
+
# are used as RSpec built them.
|
|
159
|
+
def description(metadata)
|
|
160
|
+
parent, child = metadata[:description_args]
|
|
161
|
+
return metadata[:description].to_s if metadata[:description_args].empty?
|
|
162
|
+
return description_arg(parent) unless child
|
|
163
|
+
return description_arg(child) if description_arg(parent) == ''
|
|
164
|
+
|
|
165
|
+
description_arg(parent) + description_separator(parent, child) + description_arg(child)
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
def group_full_description(metadata)
|
|
169
|
+
parent = metadata[:parent_example_group]
|
|
170
|
+
return description(metadata) unless parent
|
|
171
|
+
|
|
172
|
+
group_full_description(parent) +
|
|
173
|
+
description_separator(parent[:description_args].last, metadata[:description_args].first) +
|
|
174
|
+
description(metadata)
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
# As in RSpec: `describe Foo, '#bar'` is "Foo#bar", not "Foo #bar".
|
|
178
|
+
def description_separator(parent_arg, child_arg)
|
|
179
|
+
parent_arg.is_a?(Module) && /^(?:#|::|\.)/.match?(child_arg.to_s) ? '' : ' '
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
def description_arg(arg)
|
|
183
|
+
if arg.is_a?(Module)
|
|
184
|
+
arg.name || anonymous_module_name(arg)
|
|
185
|
+
elsif default_to_s?(arg)
|
|
186
|
+
"#<#{arg.class.name || anonymous_module_name(arg.class)}>"
|
|
187
|
+
else
|
|
188
|
+
arg.to_s
|
|
189
|
+
end
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
def anonymous_module_name(mod)
|
|
193
|
+
return '#<Module>' unless mod.is_a?(Class)
|
|
194
|
+
|
|
195
|
+
superclass = mod.superclass
|
|
196
|
+
superclass = superclass.superclass while superclass && superclass.name.nil?
|
|
197
|
+
superclass ? "#<Class < #{superclass.name}>" : '#<Class>'
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
# Kernel's method, so an object whose own #method means something else
|
|
201
|
+
# (e.g. an HTTP request's verb) is still checked.
|
|
202
|
+
def default_to_s?(arg)
|
|
203
|
+
Kernel.instance_method(:method).bind_call(arg, :to_s).owner == Kernel
|
|
204
|
+
rescue TypeError # a BasicObject
|
|
205
|
+
false
|
|
206
|
+
end
|
|
144
207
|
end
|
|
145
208
|
|
|
146
209
|
# ANSI colors for the gem's console output, without patching String.
|
|
@@ -219,7 +282,7 @@ module RSpec
|
|
|
219
282
|
unless quarantining_disabled?
|
|
220
283
|
puts Colors.yellow("Test failed, checking if it can be quarantined: `#{example.location}`")
|
|
221
284
|
end
|
|
222
|
-
result = report.is_quarantined(example.trunk_id,
|
|
285
|
+
result = report.is_quarantined(example.trunk_id, Trunk.full_description(example), Trunk.parent_name(example),
|
|
223
286
|
classname, file)
|
|
224
287
|
|
|
225
288
|
if result.quarantine_lookup_failed
|
|
@@ -457,7 +520,7 @@ module RSpec
|
|
|
457
520
|
failure_message = failure_message[0...MAX_TEXT_FIELD_SIZE] if failure_message.length > MAX_TEXT_FIELD_SIZE
|
|
458
521
|
backtrace = backtrace[0...MAX_TEXT_FIELD_SIZE] if backtrace.length > MAX_TEXT_FIELD_SIZE
|
|
459
522
|
# TODO: should we use concatenated string or alias when auto-generated description?
|
|
460
|
-
name =
|
|
523
|
+
name = Trunk.full_description(example)
|
|
461
524
|
file, classname = Trunk.file_and_classname(example)
|
|
462
525
|
line = example.metadata[:line_number]
|
|
463
526
|
started_at = example.execution_result.started_at.to_f
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rspec_trunk_flaky_tests
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.16.
|
|
4
|
+
version: 0.16.2.pre.beta.3
|
|
5
5
|
platform: aarch64-linux-gnu
|
|
6
6
|
authors:
|
|
7
7
|
- Trunk Technologies, Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-10-
|
|
11
|
+
date: 2026-10-23 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rspec-core
|