rspec_trunk_flaky_tests 0.12.2.pre.beta.1-x86_64-darwin → 0.12.2.pre.pre.beta.3-x86_64-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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b5461f9a0ae1cee3dfe2d2c7d89e3a582d7eb5278e58a09ca1d31ad7838f194e
4
- data.tar.gz: 54974605c6f5d5676042985f28ad604e0efb3227e1781e3338a1801c6dd0e11a
3
+ metadata.gz: '048359427fdf76716242f4c12d4e4ba3ed3266ced339efe30138df15848aa04e'
4
+ data.tar.gz: 6c224236770754ac49275c3179e1ad1988557e610b47984b6d309bd409561cb9
5
5
  SHA512:
6
- metadata.gz: be4fe7df42335a2ca4173f17bcaabec5f20c745e22c7035a407e1fc107de65804599495f0abe802217dc3d242e16cdaffb86d9722c72ee0cee942b206a334934
7
- data.tar.gz: 3f02e4a776831a52fa033678d6e47c5715f67783e375bb2c6dfe3b041374b98d9fa8daaffa201a54b33c4c8ca2408a2afc272f1ca98dfb4beb78b8f64fe92729
6
+ metadata.gz: ff57b1a759ef3d74fe764d48f779c82086c4d0307a0f4d723563c888a35daa413820515742c5af7b4e06aa3a64e348024f5d78ae5f89c46da13fdfce7e0d211e
7
+ data.tar.gz: b14d5d542601cf44300d1c8876b77b625078fdaf170ced3a0600440c2c947d04cb24e469ba68433971f0cf74561c351b7eccec0129c78be0f14a671321e30dd0
@@ -75,6 +75,7 @@ end
75
75
 
76
76
  # 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
77
  $test_report = TestReport.new('rspec', "#{$PROGRAM_NAME} #{ARGV.join(' ')}", nil)
78
+ $failure_encountered_and_quarantining_disabled = false
78
79
 
79
80
  module RSpec
80
81
  module Core
@@ -86,20 +87,34 @@ module RSpec
86
87
  # RSpec uses the existance of an exception to determine if the test failed
87
88
  # We need to override this to allow us to capture the exception and then
88
89
  # decide if we want to fail the test or not
89
- # trunk-ignore(rubocop/Metrics/AbcSize,rubocop/Metrics/MethodLength,rubocop/Naming/AccessorMethodName)
90
+ # trunk-ignore(rubocop/Naming/AccessorMethodName)
90
91
  def set_exception(exception)
91
92
  return set_exception_core(exception) if metadata[:pending]
92
93
  return set_exception_core(exception) if trunk_disabled
93
94
  return set_exception_core(exception) if metadata[:retry_attempts]&.positive?
94
95
 
96
+ handle_quarantine_check(exception)
97
+ end
98
+
99
+ # trunk-ignore(rubocop/Metrics/AbcSize,rubocop/Metrics/MethodLength)
100
+ def handle_quarantine_check(exception)
95
101
  id = generate_trunk_id
96
102
  name = full_description
97
103
  parent_name = example_group.metadata[:description]
98
104
  parent_name = parent_name.empty? ? 'rspec' : parent_name
99
105
  file = escape(metadata[:file_path])
100
106
  classname = file.sub(%r{\.[^/.]+\Z}, '').gsub('/', '.').gsub(/\A\.+|\.+\Z/, '')
101
- puts "Test failed, checking if it can be quarantined: `#{location}`".yellow
102
- if $test_report.is_quarantined(id, name, parent_name, classname, file)
107
+ unless $failure_encountered_and_quarantining_disabled
108
+ puts "Test failed, checking if it can be quarantined: `#{location}`".yellow
109
+ end
110
+ is_quarantined_result = $test_report.is_quarantined(id, name, parent_name, classname, file)
111
+ if is_quarantined_result.quarantining_disabled_for_repo
112
+ unless $failure_encountered_and_quarantining_disabled
113
+ puts 'Quarantining is disabled for this repo, no failures will be quarantined'.yellow
114
+ $failure_encountered_and_quarantining_disabled = true
115
+ end
116
+ set_exception_core(exception)
117
+ elsif is_quarantined_result.test_is_quarantined
103
118
  # monitor the override in the metadata
104
119
  metadata[:quarantined_exception] = exception
105
120
  puts "Test is quarantined, overriding exception: #{exception}".green
@@ -182,6 +197,9 @@ class TrunkAnalyticsListener
182
197
 
183
198
  # trunk-ignore(rubocop/Metrics/MethodLength)
184
199
  def close(_notification)
200
+ if $failure_encountered_and_quarantining_disabled
201
+ puts 'Note: Quarantining is disabled for this repo. Test failures were not quarantined.'.yellow
202
+ end
185
203
  if ENV['TRUNK_LOCAL_UPLOAD_DIR']
186
204
  saved = @testreport.try_save(ENV['TRUNK_LOCAL_UPLOAD_DIR'])
187
205
  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.2.pre.beta.1
4
+ version: 0.12.2.pre.pre.beta.3
5
5
  platform: x86_64-darwin
6
6
  authors:
7
7
  - Trunk Technologies, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-12-22 00:00:00.000000000 Z
11
+ date: 2026-01-08 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: 3.5.dev
72
+ version: 4.1.dev
72
73
  required_rubygems_version: !ruby/object:Gem::Requirement
73
74
  requirements:
74
75
  - - ">="