rspec_trunk_flaky_tests 0.12.9.pre.beta.0 → 0.12.9.pre.beta.1
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/trunk_spec_helper.rb +12 -3
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bc4ecb7fd41a240661f9bb761ce9d437df37b0699b7fe97339c95e9b983c031d
|
|
4
|
+
data.tar.gz: 2075045092b3e61fd96ffd48563a6580512737662ea1e76319605491cd7afb5b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 68e89ef7acab579d736a5e538c710ada72f9637c86f99901ee162ceed544802d79223ed09051bd61c064b2796f9199305fb7e3b95f442fc8a6c163950861139c
|
|
7
|
+
data.tar.gz: 77958d709a42c12420faf8e24db21071cf64384be399e4983cba6c7a535da89a59587df2de1d90174f2584da5558e1300466f58c498e3dd8234a3204ec5eefaf
|
data/lib/trunk_spec_helper.rb
CHANGED
|
@@ -189,6 +189,8 @@ end
|
|
|
189
189
|
# TrunkAnalyticsListener is a class that is used to listen to the execution of the Example class
|
|
190
190
|
# it generates and submits the final test reports
|
|
191
191
|
class TrunkAnalyticsListener
|
|
192
|
+
MAX_TEXT_FIELD_SIZE = 8_000
|
|
193
|
+
|
|
192
194
|
def initialize
|
|
193
195
|
@testreport = $test_report
|
|
194
196
|
end
|
|
@@ -221,8 +223,15 @@ class TrunkAnalyticsListener
|
|
|
221
223
|
|
|
222
224
|
# trunk-ignore(rubocop/Metrics/CyclomaticComplexity,rubocop/Metrics/AbcSize,rubocop/Metrics/MethodLength)
|
|
223
225
|
def add_test_case(example)
|
|
224
|
-
|
|
225
|
-
failure_message =
|
|
226
|
+
exception = example.exception || example.metadata[:quarantined_exception]
|
|
227
|
+
failure_message = ''
|
|
228
|
+
backtrace = ''
|
|
229
|
+
if exception
|
|
230
|
+
failure_message = exception.to_s
|
|
231
|
+
backtrace = exception.backtrace.join("\n") if exception.backtrace && !exception.backtrace.empty?
|
|
232
|
+
end
|
|
233
|
+
failure_message = failure_message[0...MAX_TEXT_FIELD_SIZE] if failure_message.length > MAX_TEXT_FIELD_SIZE
|
|
234
|
+
backtrace = backtrace[0...MAX_TEXT_FIELD_SIZE] if backtrace.length > MAX_TEXT_FIELD_SIZE
|
|
226
235
|
# TODO: should we use concatenated string or alias when auto-generated description?
|
|
227
236
|
name = example.full_description
|
|
228
237
|
file = escape(example.metadata[:file_path])
|
|
@@ -247,7 +256,7 @@ class TrunkAnalyticsListener
|
|
|
247
256
|
parent_name = example.example_group.metadata[:description]
|
|
248
257
|
parent_name = parent_name.empty? ? 'rspec' : parent_name
|
|
249
258
|
@testreport.add_test(id, name, classname, file, parent_name, line, status, attempt_number,
|
|
250
|
-
started_at, finished_at, failure_message || '', is_quarantined)
|
|
259
|
+
started_at, finished_at, failure_message || '', backtrace || '', is_quarantined)
|
|
251
260
|
end
|
|
252
261
|
end
|
|
253
262
|
|