rspec-mergify 0.0.8 → 0.1.0
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/README.md +1 -1
- data/lib/mergify/rspec/ci_insights.rb +1 -1
- data/lib/mergify/rspec/configuration.rb +7 -3
- data/lib/mergify/rspec/formatter.rb +4 -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: 9719211e5ed0a1fa3ac6f1f642ae5076bcd3aa0d3ad1dd432d7bc5740178f7c2
|
|
4
|
+
data.tar.gz: 6a2da476d401beac81bafcc30473e1a5daf792ec77faf9d8b8871846ff4994f9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 778948de1e1f38ac758cfada2e563bbebf9623dead6ec0fbbd89f26a52ec100cbd7ad7c1e678c04025510101146e71df1424f2be447e6efc3829dfa8f2aca8b1
|
|
7
|
+
data.tar.gz: 747f74f4ede1ede9e3186b53c98497eb9e12280e2e38b29f3ee56a1655e8e9c98e77a6e7f51dc169706c3793b830c20f9a51c390f38c07e389c0e28e883da919
|
data/README.md
CHANGED
|
@@ -13,7 +13,7 @@ require_relative 'resources/rspec'
|
|
|
13
13
|
|
|
14
14
|
module Mergify
|
|
15
15
|
module RSpec
|
|
16
|
-
# Central orchestrator for
|
|
16
|
+
# Central orchestrator for Mergify Test Insights: sets up OpenTelemetry tracing,
|
|
17
17
|
# manages the tracer provider, and coordinates flaky detection and quarantine.
|
|
18
18
|
# rubocop:disable Metrics/ClassLength
|
|
19
19
|
class CIInsights
|
|
@@ -5,7 +5,7 @@ require 'set'
|
|
|
5
5
|
module Mergify
|
|
6
6
|
module RSpec
|
|
7
7
|
# Registers RSpec hooks for quarantine and flaky detection, and adds the
|
|
8
|
-
#
|
|
8
|
+
# Mergify Test Insights formatter when running inside CI.
|
|
9
9
|
module Configuration
|
|
10
10
|
module_function
|
|
11
11
|
|
|
@@ -64,6 +64,10 @@ module Mergify
|
|
|
64
64
|
distinct_outcomes.add(example.execution_result.status) if example.execution_result.status
|
|
65
65
|
|
|
66
66
|
rerun_count = 0
|
|
67
|
+
# Use a null reporter to prevent reruns from being reported as
|
|
68
|
+
# individual failures. The final outcome is set after the loop.
|
|
69
|
+
null_reporter = ::RSpec::Core::NullReporter
|
|
70
|
+
|
|
67
71
|
until example.metadata[:is_last_rerun]
|
|
68
72
|
example.metadata[:is_last_rerun] = fd.last_rerun_for_test?(example.id)
|
|
69
73
|
|
|
@@ -80,7 +84,7 @@ module Mergify
|
|
|
80
84
|
end
|
|
81
85
|
end
|
|
82
86
|
|
|
83
|
-
example.run
|
|
87
|
+
example.run(example.example_group_instance, null_reporter)
|
|
84
88
|
|
|
85
89
|
# Feed rerun metrics so budget/deadline tracking stays accurate
|
|
86
90
|
rerun_time = example.execution_result.run_time || 0.0
|
|
@@ -103,7 +107,7 @@ module Mergify
|
|
|
103
107
|
|
|
104
108
|
example.instance_variable_set(:@exception, nil)
|
|
105
109
|
example.execution_result.status = :pending
|
|
106
|
-
example.execution_result.pending_message = 'Test is quarantined from Mergify
|
|
110
|
+
example.execution_result.pending_message = 'Test is quarantined from Mergify Test Insights'
|
|
107
111
|
end
|
|
108
112
|
end
|
|
109
113
|
end
|
|
@@ -5,7 +5,7 @@ require 'opentelemetry-sdk'
|
|
|
5
5
|
|
|
6
6
|
module Mergify
|
|
7
7
|
module RSpec
|
|
8
|
-
# RSpec formatter that creates OpenTelemetry spans for
|
|
8
|
+
# RSpec formatter that creates OpenTelemetry spans for Mergify Test Insights and
|
|
9
9
|
# prints a terminal report. It is purely observational and does not modify
|
|
10
10
|
# test execution.
|
|
11
11
|
# rubocop:disable Metrics/ClassLength
|
|
@@ -134,6 +134,7 @@ module Mergify
|
|
|
134
134
|
def set_error_attributes(span, exception)
|
|
135
135
|
span.set_attribute('exception.type', exception.class.to_s)
|
|
136
136
|
span.set_attribute('exception.message', exception.message)
|
|
137
|
+
span.set_attribute('exception.stacktrace', exception.backtrace&.join("\n") || '')
|
|
137
138
|
span.status = OpenTelemetry::Trace::Status.error(exception.message)
|
|
138
139
|
end
|
|
139
140
|
|
|
@@ -154,7 +155,7 @@ module Mergify
|
|
|
154
155
|
output.puts '--- Mergify CI ---'
|
|
155
156
|
|
|
156
157
|
unless @ci_insights
|
|
157
|
-
output.puts 'Mergify
|
|
158
|
+
output.puts 'Mergify Test Insights is not configured.'
|
|
158
159
|
return
|
|
159
160
|
end
|
|
160
161
|
|
|
@@ -210,7 +211,7 @@ module Mergify
|
|
|
210
211
|
output.puts ''
|
|
211
212
|
output.puts 'Common issues:'
|
|
212
213
|
output.puts ' - Your MERGIFY_TOKEN might not be set or could be invalid'
|
|
213
|
-
output.puts ' -
|
|
214
|
+
output.puts ' - Mergify Test Insights might not be enabled for this repository'
|
|
214
215
|
output.puts ' - There might be a network connectivity issue with the Mergify API'
|
|
215
216
|
output.puts ''
|
|
216
217
|
output.puts 'Documentation: https://docs.mergify.com/ci-insights/test-frameworks/'
|