rspec_trunk_flaky_tests 0.12.10 → 0.12.11.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 +17 -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: 99d1fd44931c4592cfdbeff9527567d0330b8bb76eee4a4f5c608e8fb08f45b4
|
|
4
|
+
data.tar.gz: 82e216a32a19291f335a2f7ef750d6a95bf6cd23b8d2c4154947d75daf06af2b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 98c117344b67c06e07b61e515b72393517712f58a2370ac7834a86ccc3ceea8eb806c7a4b9d6ae194f152f3d6cc6c2a785b069ea647d1061fd0ba7d28090e15a
|
|
7
|
+
data.tar.gz: 0b17ee5631b648a82fe0905e6918e24e1abe880c43fe7d7fb265a4e659b30724e1359ada1eb60a026578a1908c249947325d9b9a5cc36a95cf28542785d4d46f
|
data/lib/trunk_spec_helper.rb
CHANGED
|
@@ -34,6 +34,8 @@ require 'rspec/core/formatters/exception_presenter'
|
|
|
34
34
|
require 'time'
|
|
35
35
|
require 'rspec_trunk_flaky_tests'
|
|
36
36
|
|
|
37
|
+
# trunk-ignore-all(rubocop/Style/GlobalVars)
|
|
38
|
+
|
|
37
39
|
# String is an override to the main String class that is used to colorize the output
|
|
38
40
|
# it is used to make the output more readable
|
|
39
41
|
class String
|
|
@@ -85,6 +87,7 @@ end
|
|
|
85
87
|
# we want to cache the test report in memory so we can add to it as we go and reduce the number of API calls
|
|
86
88
|
$test_report = TestReport.new('rspec', "#{$PROGRAM_NAME} #{ARGV.join(' ')}", nil)
|
|
87
89
|
$failure_encountered_and_quarantining_disabled = false
|
|
90
|
+
$failure_encountered_and_quarantine_lookup_failed = false
|
|
88
91
|
|
|
89
92
|
module RSpec
|
|
90
93
|
module Core
|
|
@@ -105,7 +108,7 @@ module RSpec
|
|
|
105
108
|
handle_quarantine_check(exception)
|
|
106
109
|
end
|
|
107
110
|
|
|
108
|
-
# trunk-ignore(rubocop/Metrics/AbcSize,rubocop/Metrics/MethodLength)
|
|
111
|
+
# trunk-ignore(rubocop/Metrics/AbcSize,rubocop/Metrics/MethodLength,rubocop/Metrics/CyclomaticComplexity)
|
|
109
112
|
def handle_quarantine_check(exception)
|
|
110
113
|
id = generate_trunk_id
|
|
111
114
|
name = full_description
|
|
@@ -117,7 +120,14 @@ module RSpec
|
|
|
117
120
|
puts "Test failed, checking if it can be quarantined: `#{location}`".yellow
|
|
118
121
|
end
|
|
119
122
|
is_quarantined_result = $test_report.is_quarantined(id, name, parent_name, classname, file)
|
|
120
|
-
|
|
123
|
+
|
|
124
|
+
if is_quarantined_result.quarantine_lookup_failed
|
|
125
|
+
unless $failure_encountered_and_quarantine_lookup_failed
|
|
126
|
+
puts 'Failed to check quarantining status, no failures will be quarantined'.yellow
|
|
127
|
+
$failure_encountered_and_quarantine_lookup_failed = true
|
|
128
|
+
end
|
|
129
|
+
set_exception_core(exception)
|
|
130
|
+
elsif is_quarantined_result.quarantining_disabled_for_repo
|
|
121
131
|
unless $failure_encountered_and_quarantining_disabled
|
|
122
132
|
puts 'Quarantining is disabled for this repo, no failures will be quarantined'.yellow
|
|
123
133
|
$failure_encountered_and_quarantining_disabled = true
|
|
@@ -287,11 +297,15 @@ class TrunkAnalyticsListener
|
|
|
287
297
|
add_test_case(notification.example)
|
|
288
298
|
end
|
|
289
299
|
|
|
290
|
-
# trunk-ignore(rubocop/Metrics/MethodLength)
|
|
300
|
+
# trunk-ignore(rubocop/Metrics/MethodLength,rubocop/Metrics/AbcSize)
|
|
291
301
|
def close(_notification)
|
|
292
302
|
if $failure_encountered_and_quarantining_disabled
|
|
293
303
|
puts 'Note: Quarantining is disabled for this repo. Test failures were not quarantined.'.yellow
|
|
294
304
|
end
|
|
305
|
+
if $failure_encountered_and_quarantine_lookup_failed
|
|
306
|
+
puts 'Note: Failed to check quarantining status. Test failures were not quarantined.'.yellow
|
|
307
|
+
end
|
|
308
|
+
|
|
295
309
|
if ENV['TRUNK_LOCAL_UPLOAD_DIR']
|
|
296
310
|
saved = @testreport.try_save(ENV['TRUNK_LOCAL_UPLOAD_DIR'])
|
|
297
311
|
if saved
|