rspec_trunk_flaky_tests 0.13.7-x86_64-darwin → 0.14.0.pre.beta.1-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: 0dbd6a713cf08930c69d88fb90e4dc1b60367e30272418c8bef3e07436586c22
4
- data.tar.gz: f1830ae93fffb5d78cecaaa38123c110b9b42fc2390ea8810918cf32dc7e6921
3
+ metadata.gz: a623f8740c78cdaa4d19396d5e32bdc13f1b7b6fd8ceb13bcf5a213abf31cf61
4
+ data.tar.gz: 9e8fb77c9ebac9747f1e176c88076eb42847e8a4387600684322f527c48a362b
5
5
  SHA512:
6
- metadata.gz: 8f3c0809496d7701e4fcea227cbf3c68998c9d8406bc6fa0ce3e6a73b29138110ee08f938bfa7df5a3129f8c873f304558f4d6a026abbea2a31664d3b52f6df3
7
- data.tar.gz: a0c9aeda25f8b81f9f35393b7eafc1e7ffc813fa0c4b0cb346dba01f94eff610fc05bd4d8024640126240934e87afeaace15e3061f1592050307e99ab6ceb2b4
6
+ metadata.gz: 34232de04fdc3aefae7fbfe6118c43dafb97cb153f9bae1292d66fd5c024fdcd8c77d05e688abaae985dae554e4ec774e2ee8350c5c82936559763f2d2025068
7
+ data.tar.gz: 3220aaa9c4ad241b5c6625bd3e34d2d146de6e4332dcc920043bec14ac5457bfeb8acb2ffa60244a1f5fefbe2a1d104ad709bfe16b14b9688975ee6b5a4ad873
@@ -15,7 +15,8 @@ rescue LoadError
15
15
  this dependency. It does not include a precompiled native extension.
16
16
 
17
17
  Precompiled native gems are available for:
18
- x86_64-linux, aarch64-linux, arm64-darwin, x86_64-darwin
18
+ x86_64-linux-gnu, x86_64-linux-musl, aarch64-linux-gnu,
19
+ aarch64-linux-musl, arm64-darwin, x86_64-darwin
19
20
 
20
21
  If you are on a supported platform and seeing this error, make sure
21
22
  bundler is selecting the native variant for your platform:
@@ -336,7 +336,7 @@ class TrunkAnalyticsListener
336
336
 
337
337
  # trunk-ignore(rubocop/Metrics/CyclomaticComplexity,rubocop/Metrics/AbcSize,rubocop/Metrics/MethodLength)
338
338
  def add_test_case(example)
339
- exception = example.exception || example.metadata[:quarantined_exception]
339
+ status, exception = status_and_exception(example)
340
340
  failure_message = ''
341
341
  backtrace = ''
342
342
  if exception
@@ -355,22 +355,60 @@ class TrunkAnalyticsListener
355
355
  id = example.generate_trunk_id
356
356
 
357
357
  attempt_number = example.metadata[:retry_attempts] || example.metadata[:attempt_number] || 0
358
- status = example.execution_result.status.to_s
359
358
  # set the status to failure, but mark it as quarantined
360
359
  is_quarantined = example.metadata[:quarantined_exception] ? true : false
361
- case example.execution_result.status
362
- when :passed
363
- status = is_quarantined ? Status.new('failure') : Status.new('success')
364
- when :failed
365
- status = Status.new('failure')
366
- when :pending
367
- status = Status.new('skipped')
368
- end
369
360
  parent_name = example.example_group.metadata[:description]
370
361
  parent_name = parent_name.empty? ? 'rspec' : parent_name
371
362
  @testreport.add_test(id, name, classname, file, parent_name, line, status, attempt_number,
372
363
  started_at, finished_at, failure_message || '', backtrace || '', is_quarantined)
373
364
  end
365
+
366
+ # Determine the Trunk status to report for an example, plus the exception (if
367
+ # any) whose message/backtrace should be recorded for it.
368
+ #
369
+ # `pending` examples need care because RSpec expresses their outcome as the
370
+ # inverse of the body's pass/fail. A pending example's contract is "this is
371
+ # expected to fail", so:
372
+ # - body still fails -> expectation met -> RSpec status :pending, build green
373
+ # - body now passes -> expectation violated -> RSpec status :failed
374
+ # (PendingExampleFixedError), build red
375
+ # We report the outcome RSpec actually decided, which also matches the build
376
+ # result:
377
+ # - skip / xit (never ran) -> skipped
378
+ # - pending, body still failing -> success (expectation met)
379
+ # - pending, body now passing -> failure (PendingExampleFixedError)
380
+ # RSpec's own build pass/fail behavior is left untouched (see #set_exception).
381
+ #
382
+ # trunk-ignore(rubocop/Metrics/AbcSize,rubocop/Metrics/CyclomaticComplexity,rubocop/Metrics/MethodLength)
383
+ def status_and_exception(example)
384
+ result = example.execution_result
385
+ quarantined_exception = example.metadata[:quarantined_exception]
386
+
387
+ # A genuinely skipped example (`skip`/`xit`, or `skip` called from a hook or
388
+ # body) never runs, so it has no real pass/fail outcome. RSpec still reports
389
+ # it with status :pending, so detect skips explicitly -- and up front -- via
390
+ # metadata[:skip] before interpreting any pending pass/fail semantics below.
391
+ return [Status.new('skipped'), nil] if example.metadata[:skip]
392
+
393
+ case result.status
394
+ when :passed
395
+ # A quarantined failure is recorded as :passed by RSpec (see #set_exception),
396
+ # so report it as a failure but carry the original quarantined exception.
397
+ quarantined_exception ? [Status.new('failure'), quarantined_exception] : [Status.new('success'), nil]
398
+ when :failed
399
+ # Includes a pending example whose body unexpectedly passed: RSpec reports it
400
+ # as :failed with a PendingExampleFixedError (on example.exception) and breaks
401
+ # the build (the pending expectation was violated), so it is a failure here too.
402
+ [Status.new('failure'), example.exception || quarantined_exception]
403
+ when :pending
404
+ # Not a skip (handled above), so this is a pending example whose body ran and
405
+ # failed as expected: the pending expectation ("this should fail") was met, so
406
+ # RSpec keeps the build green -- report it as a success.
407
+ [Status.new('success'), nil]
408
+ else
409
+ [Status.new(result.status.to_s), example.exception || quarantined_exception]
410
+ end
411
+ end
374
412
  end
375
413
 
376
414
  RSpec.configure do |c|
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.13.7
4
+ version: 0.14.0.pre.beta.1
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: 2026-07-06 00:00:00.000000000 Z
11
+ date: 2026-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec-core
@@ -47,7 +47,6 @@ extensions: []
47
47
  extra_rdoc_files: []
48
48
  files:
49
49
  - lib/rspec_trunk_flaky_tests.rb
50
- - lib/rspec_trunk_flaky_tests/3.0/rspec_trunk_flaky_tests.bundle
51
50
  - lib/rspec_trunk_flaky_tests/3.1/rspec_trunk_flaky_tests.bundle
52
51
  - lib/rspec_trunk_flaky_tests/3.2/rspec_trunk_flaky_tests.bundle
53
52
  - lib/rspec_trunk_flaky_tests/3.3/rspec_trunk_flaky_tests.bundle
@@ -67,7 +66,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
67
66
  requirements:
68
67
  - - ">="
69
68
  - !ruby/object:Gem::Version
70
- version: '3.0'
69
+ version: '3.1'
71
70
  - - "<"
72
71
  - !ruby/object:Gem::Version
73
72
  version: 4.1.dev