rspec_trunk_flaky_tests 0.12.2.pre.beta.2-arm64-darwin → 0.12.3-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/trunk_spec_helper.rb +23 -4
- 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: 1c0dbd9c96f0b331ee2b8b26e4ef7c4af7744cc0d1130face1730ae70baae3e6
|
|
4
|
+
data.tar.gz: 4e9bd7a10778f0a1d7907307ab8b6779fe97ccb06f6f92b20cfa449cf447f84d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c88639bdf694fc8968fd9d1cb454a6427a42b2ede896f59d0be2371e293925ca24e737b6f1c2d3feb536552403df8f90b29ab891e2f8798b95ece677b0cf3016
|
|
7
|
+
data.tar.gz: 41a23a661bdba5069567aa7527a13797bd61060d9910e235624a0b5e77070a12ff39923285226a41c3f3f5a1bf4da7ca259bd9787c5b44d5e4063173aeb0be80
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
data/lib/trunk_spec_helper.rb
CHANGED
|
@@ -65,7 +65,8 @@ end
|
|
|
65
65
|
|
|
66
66
|
def knapsack_detector_command?
|
|
67
67
|
command_line = "#{$PROGRAM_NAME} #{ARGV.join(' ')}".strip
|
|
68
|
-
command_line.include?('knapsack_pro:rspec_test_example_detector')
|
|
68
|
+
command_line.include?('knapsack_pro:rspec_test_example_detector') ||
|
|
69
|
+
command_line.include?('knapsack_pro:queue:rspec:initialize')
|
|
69
70
|
end
|
|
70
71
|
|
|
71
72
|
def trunk_disabled
|
|
@@ -75,6 +76,7 @@ end
|
|
|
75
76
|
|
|
76
77
|
# 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
|
|
77
78
|
$test_report = TestReport.new('rspec', "#{$PROGRAM_NAME} #{ARGV.join(' ')}", nil)
|
|
79
|
+
$failure_encountered_and_quarantining_disabled = false
|
|
78
80
|
|
|
79
81
|
module RSpec
|
|
80
82
|
module Core
|
|
@@ -86,20 +88,34 @@ module RSpec
|
|
|
86
88
|
# RSpec uses the existance of an exception to determine if the test failed
|
|
87
89
|
# We need to override this to allow us to capture the exception and then
|
|
88
90
|
# decide if we want to fail the test or not
|
|
89
|
-
# trunk-ignore(rubocop/
|
|
91
|
+
# trunk-ignore(rubocop/Naming/AccessorMethodName)
|
|
90
92
|
def set_exception(exception)
|
|
91
93
|
return set_exception_core(exception) if metadata[:pending]
|
|
92
94
|
return set_exception_core(exception) if trunk_disabled
|
|
93
95
|
return set_exception_core(exception) if metadata[:retry_attempts]&.positive?
|
|
94
96
|
|
|
97
|
+
handle_quarantine_check(exception)
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# trunk-ignore(rubocop/Metrics/AbcSize,rubocop/Metrics/MethodLength)
|
|
101
|
+
def handle_quarantine_check(exception)
|
|
95
102
|
id = generate_trunk_id
|
|
96
103
|
name = full_description
|
|
97
104
|
parent_name = example_group.metadata[:description]
|
|
98
105
|
parent_name = parent_name.empty? ? 'rspec' : parent_name
|
|
99
106
|
file = escape(metadata[:file_path])
|
|
100
107
|
classname = file.sub(%r{\.[^/.]+\Z}, '').gsub('/', '.').gsub(/\A\.+|\.+\Z/, '')
|
|
101
|
-
|
|
102
|
-
|
|
108
|
+
unless $failure_encountered_and_quarantining_disabled
|
|
109
|
+
puts "Test failed, checking if it can be quarantined: `#{location}`".yellow
|
|
110
|
+
end
|
|
111
|
+
is_quarantined_result = $test_report.is_quarantined(id, name, parent_name, classname, file)
|
|
112
|
+
if is_quarantined_result.quarantining_disabled_for_repo
|
|
113
|
+
unless $failure_encountered_and_quarantining_disabled
|
|
114
|
+
puts 'Quarantining is disabled for this repo, no failures will be quarantined'.yellow
|
|
115
|
+
$failure_encountered_and_quarantining_disabled = true
|
|
116
|
+
end
|
|
117
|
+
set_exception_core(exception)
|
|
118
|
+
elsif is_quarantined_result.test_is_quarantined
|
|
103
119
|
# monitor the override in the metadata
|
|
104
120
|
metadata[:quarantined_exception] = exception
|
|
105
121
|
puts "Test is quarantined, overriding exception: #{exception}".green
|
|
@@ -182,6 +198,9 @@ class TrunkAnalyticsListener
|
|
|
182
198
|
|
|
183
199
|
# trunk-ignore(rubocop/Metrics/MethodLength)
|
|
184
200
|
def close(_notification)
|
|
201
|
+
if $failure_encountered_and_quarantining_disabled
|
|
202
|
+
puts 'Note: Quarantining is disabled for this repo. Test failures were not quarantined.'.yellow
|
|
203
|
+
end
|
|
185
204
|
if ENV['TRUNK_LOCAL_UPLOAD_DIR']
|
|
186
205
|
saved = @testreport.try_save(ENV['TRUNK_LOCAL_UPLOAD_DIR'])
|
|
187
206
|
if saved
|
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.3
|
|
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:
|
|
11
|
+
date: 2026-01-30 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rspec-core
|
|
@@ -52,6 +52,7 @@ files:
|
|
|
52
52
|
- lib/rspec_trunk_flaky_tests/3.2/rspec_trunk_flaky_tests.bundle
|
|
53
53
|
- lib/rspec_trunk_flaky_tests/3.3/rspec_trunk_flaky_tests.bundle
|
|
54
54
|
- lib/rspec_trunk_flaky_tests/3.4/rspec_trunk_flaky_tests.bundle
|
|
55
|
+
- lib/rspec_trunk_flaky_tests/4.0/rspec_trunk_flaky_tests.bundle
|
|
55
56
|
- lib/trunk_spec_helper.rb
|
|
56
57
|
homepage: https://docs.trunk.io/flaky-tests/get-started/frameworks/rspec
|
|
57
58
|
licenses:
|
|
@@ -68,7 +69,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
68
69
|
version: '3.0'
|
|
69
70
|
- - "<"
|
|
70
71
|
- !ruby/object:Gem::Version
|
|
71
|
-
version:
|
|
72
|
+
version: 4.1.dev
|
|
72
73
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
73
74
|
requirements:
|
|
74
75
|
- - ">="
|