rspec_trunk_flaky_tests 0.7.6-aarch64-linux → 0.7.8-aarch64-linux

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: '036314043582f4d12501984763da8b39cd62a36d9056749eb46ce8eae443655a'
4
- data.tar.gz: aae1bacdf05bdd611f77ae62345a2e041eadef4330f0ab1568606d43196fb15c
3
+ metadata.gz: 55840178d09f8994984f34ab0e65d8f063f3146556d520a03c83bfedd92dbcfd
4
+ data.tar.gz: 3a0478a3642bc7245c3e098b1c45d666170f42143757ab62271f43d35e51ae72
5
5
  SHA512:
6
- metadata.gz: af47f814fa2a1e7267ba101d72364a0a1904a97fdeedef7fbf730ab71b51f8235bf5965a411165d23d723f1498d6e2d216ea5e8f681a6fc5b075df13d029eed9
7
- data.tar.gz: 3d5f0250cbb6e884209dd578208eb0d79b685ba248a727e58ca68283db322da9c62b502c54d5013215967f702cd068ba9b3ed462c39a36b783bec2370fe8ab36
6
+ metadata.gz: 889576a763d33e361c6987d67542e932fb41dc744ae26fa65d13e5740bcb6de00f785fa74f32ec392b27f575ae49d09a99f0b84e99f23cb15ee12fb3415537cf
7
+ data.tar.gz: 2929c27d380e250cb76d9f8f6a86b3bdcf394129c35c28bfe97a91f1a97c3e3ed40a874edf0e9e4140ea5fa884747efaf154cb75dc3949fc68de911a80012acc
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -28,18 +28,6 @@ def escape(str)
28
28
  str.dump[1..-2]
29
29
  end
30
30
 
31
- def description_generated?(example)
32
- auto_generated_exp = /^\s?is expected to .*$/
33
- full_description = example.full_description
34
- parent_description = example.example_group.description
35
- checked_description = full_description.sub(parent_description, '')
36
- !auto_generated_exp.match(checked_description).nil? || full_description.empty?
37
- end
38
-
39
- def generate_id(example)
40
- return "trunk:#{example.id}-#{example.location}" if description_generated?(example)
41
- end
42
-
43
31
  def trunk_disabled
44
32
  ENV['DISABLE_RSPEC_TRUNK_FLAKY_TESTS'] == 'true' || ENV['TRUNK_ORG_URL_SLUG'].nil? || ENV['TRUNK_API_TOKEN'].nil?
45
33
  end
@@ -53,14 +41,16 @@ module RSpec
53
41
  class Example
54
42
  # keep the original method around so we can call it
55
43
  alias set_exception_core set_exception
44
+ alias assign_generated_description_core assign_generated_description
56
45
  # RSpec uses the existance of an exception to determine if the test failed
57
46
  # We need to override this to allow us to capture the exception and then
58
47
  # decide if we want to fail the test or not
59
48
  # trunk-ignore(rubocop/Naming/AccessorMethodName,rubocop/Metrics/MethodLength,rubocop/Metrics/AbcSize)
60
49
  def set_exception(exception)
61
50
  return set_exception_core(exception) if trunk_disabled
51
+ return set_exception_core(exception) if metadata[:retry_attempts]&.positive?
62
52
 
63
- id = generate_id(self)
53
+ id = generate_trunk_id
64
54
  name = full_description
65
55
  parent_name = example_group.metadata[:description]
66
56
  parent_name = parent_name.empty? ? 'rspec' : parent_name
@@ -78,6 +68,21 @@ module RSpec
78
68
  end
79
69
  end
80
70
 
71
+ def assign_generated_description
72
+ metadata[:is_description_generated] = description_generated?
73
+ assign_generated_description_core
74
+ end
75
+
76
+ def description_generated?
77
+ return metadata[:is_description_generated] unless metadata[:is_description_generated].nil?
78
+
79
+ description == location_description
80
+ end
81
+
82
+ def generate_trunk_id
83
+ return "trunk:#{id}-#{location}" if description_generated?
84
+ end
85
+
81
86
  # Procsy is a class that is used to wrap execution of the Example class
82
87
  class Procsy
83
88
  def run_with_trunk
@@ -134,8 +139,7 @@ class TrunkAnalyticsListener
134
139
  end
135
140
 
136
141
  def close(_notification)
137
- res = @testreport.publish
138
- if res
142
+ if @testreport.publish
139
143
  puts 'Flaky tests report upload complete'.green
140
144
  else
141
145
  puts 'Failed to publish flaky tests report'.red
@@ -153,9 +157,9 @@ class TrunkAnalyticsListener
153
157
  line = example.metadata[:line_number]
154
158
  started_at = example.execution_result.started_at.to_i
155
159
  finished_at = example.execution_result.finished_at.to_i
156
- id = generate_id(example)
160
+ id = example.generate_trunk_id
157
161
 
158
- attempt_number = example.metadata[:attempt_number] || 0
162
+ attempt_number = example.metadata[:retry_attempts] || example.metadata[:attempt_number] || 0
159
163
  status = example.execution_result.status.to_s
160
164
  # set the status to failure, but mark it as quarantined
161
165
  is_quarantined = example.metadata[:quarantined_exception] ? true : false
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.7.6
4
+ version: 0.7.8
5
5
  platform: aarch64-linux
6
6
  authors:
7
7
  - Trunk Technologies, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-04-02 00:00:00.000000000 Z
11
+ date: 2025-04-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec-core