rspec_trunk_flaky_tests 0.12.8-arm64-darwin → 0.12.9-arm64-darwin
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.0/rspec_trunk_flaky_tests.bundle +0 -0
- data/lib/rspec_trunk_flaky_tests/3.1/rspec_trunk_flaky_tests.bundle +0 -0
- data/lib/rspec_trunk_flaky_tests/3.2/rspec_trunk_flaky_tests.bundle +0 -0
- data/lib/rspec_trunk_flaky_tests/3.3/rspec_trunk_flaky_tests.bundle +0 -0
- data/lib/rspec_trunk_flaky_tests/3.4/rspec_trunk_flaky_tests.bundle +0 -0
- data/lib/rspec_trunk_flaky_tests/4.0/rspec_trunk_flaky_tests.bundle +0 -0
- data/lib/rspec_trunk_flaky_tests.rb +27 -1
- data/lib/trunk_spec_helper.rb +41 -3
- metadata +4 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 71334d413030572e1a7d720f8807882d82d752ae16b4c73d3f0f793f8ceb7d86
|
|
4
|
+
data.tar.gz: e446bd913e8082fca75bd3f7ad5f0b73e3709b773966c62dfc5aefaaf4039617
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 72c0f80c3f8370c1e31ebdbe9d1bf2efdbd21b5a2914a348c956091cdfea96502b5fc109947f2e15f021e1bb25c5aeb4cb89a2e1470be0b1f38ecdda343b45fa
|
|
7
|
+
data.tar.gz: f657f4285de327d5ed28cea140a2e74bd91126079ae68f82456389cdb7180c26ce0e227521940e3da5cc6053653ac4beea182f05a15aad62880c78242fa14a54
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -4,5 +4,31 @@ begin
|
|
|
4
4
|
ruby_version = /(\d+\.\d+)/.match(RUBY_VERSION)
|
|
5
5
|
require_relative "rspec_trunk_flaky_tests/#{ruby_version}/rspec_trunk_flaky_tests"
|
|
6
6
|
rescue LoadError
|
|
7
|
-
|
|
7
|
+
begin
|
|
8
|
+
require_relative 'rspec_trunk_flaky_tests/rspec_trunk_flaky_tests'
|
|
9
|
+
rescue LoadError
|
|
10
|
+
raise LoadError, <<~MSG
|
|
11
|
+
Could not load the native extension for rspec_trunk_flaky_tests.
|
|
12
|
+
|
|
13
|
+
You are using the pure ruby variant of this gem, which is a placeholder
|
|
14
|
+
that exists so that Gemfile.lock files with `PLATFORMS ruby` can resolve
|
|
15
|
+
this dependency. It does not include a precompiled native extension.
|
|
16
|
+
|
|
17
|
+
Precompiled native gems are available for:
|
|
18
|
+
x86_64-linux, aarch64-linux, arm64-darwin, x86_64-darwin
|
|
19
|
+
|
|
20
|
+
If you are on a supported platform and seeing this error, make sure
|
|
21
|
+
bundler is selecting the native variant for your platform:
|
|
22
|
+
|
|
23
|
+
bundle lock --add-platform #{RUBY_PLATFORM}
|
|
24
|
+
bundle install
|
|
25
|
+
|
|
26
|
+
If you are on an unsupported platform, this gem cannot be used in your
|
|
27
|
+
environment. Please open an issue at:
|
|
28
|
+
https://github.com/trunk-io/analytics-cli/issues
|
|
29
|
+
|
|
30
|
+
Current platform: #{RUBY_PLATFORM}
|
|
31
|
+
Current Ruby version: #{RUBY_VERSION}
|
|
32
|
+
MSG
|
|
33
|
+
end
|
|
8
34
|
end
|
data/lib/trunk_spec_helper.rb
CHANGED
|
@@ -186,9 +186,40 @@ module RSpec
|
|
|
186
186
|
end
|
|
187
187
|
end
|
|
188
188
|
|
|
189
|
+
def format_exception_message(exception)
|
|
190
|
+
case exception
|
|
191
|
+
when RSpec::Core::MultipleExceptionError
|
|
192
|
+
# MultipleExceptionError contains multiple exceptions in @exceptions array
|
|
193
|
+
messages = exception.all_exceptions.map { |e| "#{e.class}: #{e.message}" }
|
|
194
|
+
"#{exception.class}: #{messages.join(' | ')}"
|
|
195
|
+
else
|
|
196
|
+
exception.to_s
|
|
197
|
+
end
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
# trunk-ignore(rubocop/Metrics/MethodLength)
|
|
201
|
+
def format_exception_backtrace(exception)
|
|
202
|
+
case exception
|
|
203
|
+
when RSpec::Core::MultipleExceptionError
|
|
204
|
+
# Collect backtraces from all nested exceptions
|
|
205
|
+
backtraces = exception.all_exceptions.map do |e|
|
|
206
|
+
if e.backtrace && !e.backtrace.empty?
|
|
207
|
+
"#{e.class}: #{e.message}\n#{e.backtrace.join("\n")}"
|
|
208
|
+
else
|
|
209
|
+
"#{e.class}: #{e.message}"
|
|
210
|
+
end
|
|
211
|
+
end
|
|
212
|
+
backtraces.join("\n\n")
|
|
213
|
+
else
|
|
214
|
+
exception.backtrace&.join("\n") || ''
|
|
215
|
+
end
|
|
216
|
+
end
|
|
217
|
+
|
|
189
218
|
# TrunkAnalyticsListener is a class that is used to listen to the execution of the Example class
|
|
190
219
|
# it generates and submits the final test reports
|
|
191
220
|
class TrunkAnalyticsListener
|
|
221
|
+
MAX_TEXT_FIELD_SIZE = 8_000
|
|
222
|
+
|
|
192
223
|
def initialize
|
|
193
224
|
@testreport = $test_report
|
|
194
225
|
end
|
|
@@ -221,8 +252,15 @@ class TrunkAnalyticsListener
|
|
|
221
252
|
|
|
222
253
|
# trunk-ignore(rubocop/Metrics/CyclomaticComplexity,rubocop/Metrics/AbcSize,rubocop/Metrics/MethodLength)
|
|
223
254
|
def add_test_case(example)
|
|
224
|
-
|
|
225
|
-
failure_message =
|
|
255
|
+
exception = example.exception || example.metadata[:quarantined_exception]
|
|
256
|
+
failure_message = ''
|
|
257
|
+
backtrace = ''
|
|
258
|
+
if exception
|
|
259
|
+
failure_message = format_exception_message(exception)
|
|
260
|
+
backtrace = format_exception_backtrace(exception)
|
|
261
|
+
end
|
|
262
|
+
failure_message = failure_message[0...MAX_TEXT_FIELD_SIZE] if failure_message.length > MAX_TEXT_FIELD_SIZE
|
|
263
|
+
backtrace = backtrace[0...MAX_TEXT_FIELD_SIZE] if backtrace.length > MAX_TEXT_FIELD_SIZE
|
|
226
264
|
# TODO: should we use concatenated string or alias when auto-generated description?
|
|
227
265
|
name = example.full_description
|
|
228
266
|
file = escape(example.metadata[:file_path])
|
|
@@ -247,7 +285,7 @@ class TrunkAnalyticsListener
|
|
|
247
285
|
parent_name = example.example_group.metadata[:description]
|
|
248
286
|
parent_name = parent_name.empty? ? 'rspec' : parent_name
|
|
249
287
|
@testreport.add_test(id, name, classname, file, parent_name, line, status, attempt_number,
|
|
250
|
-
started_at, finished_at, failure_message || '', is_quarantined)
|
|
288
|
+
started_at, finished_at, failure_message || '', backtrace || '', is_quarantined)
|
|
251
289
|
end
|
|
252
290
|
end
|
|
253
291
|
|
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.12.
|
|
4
|
+
version: 0.12.9
|
|
5
5
|
platform: arm64-darwin
|
|
6
6
|
authors:
|
|
7
7
|
- Trunk Technologies, Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-04-
|
|
11
|
+
date: 2026-04-28 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rspec-core
|
|
@@ -57,7 +57,8 @@ files:
|
|
|
57
57
|
homepage: https://docs.trunk.io/flaky-tests/get-started/frameworks/rspec
|
|
58
58
|
licenses:
|
|
59
59
|
- MIT
|
|
60
|
-
metadata:
|
|
60
|
+
metadata:
|
|
61
|
+
source_code_uri: https://github.com/trunk-io/analytics-cli/tree/main/rspec-trunk-flaky-tests
|
|
61
62
|
post_install_message:
|
|
62
63
|
rdoc_options: []
|
|
63
64
|
require_paths:
|