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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b2aa62d95ba898d757936c94d09afcd0d2159431ecec165322c55bf2587a3cdc
4
- data.tar.gz: fd0d8d9b9b0546f6c57c5452071633e74c05699aa04d99a27fc94be33be055a7
3
+ metadata.gz: 9719211e5ed0a1fa3ac6f1f642ae5076bcd3aa0d3ad1dd432d7bc5740178f7c2
4
+ data.tar.gz: 6a2da476d401beac81bafcc30473e1a5daf792ec77faf9d8b8871846ff4994f9
5
5
  SHA512:
6
- metadata.gz: 13a96cbd8cca285d5b63135663ee3704e6ba376fc6b10b124b9154ee398810eab1ce78712f01579e8eb28e0a90d17ed2766dc4e5694099ad98b32cc2d135ba12
7
- data.tar.gz: 88d6b19106bffab709aa494ddabab89c959c5fc28397f2c01d220f8cbded9882b450fccbb8f48f238e79a14a935a05a18b496f9f8e98bc1fbd89edad66b61ad6
6
+ metadata.gz: 778948de1e1f38ac758cfada2e563bbebf9623dead6ec0fbbd89f26a52ec100cbd7ad7c1e678c04025510101146e71df1424f2be447e6efc3829dfa8f2aca8b1
7
+ data.tar.gz: 747f74f4ede1ede9e3186b53c98497eb9e12280e2e38b29f3ee56a1655e8e9c98e77a6e7f51dc169706c3793b830c20f9a51c390f38c07e389c0e28e883da919
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # rspec-mergify
2
2
 
3
- RSpec plugin for [Mergify CI Insights](https://docs.mergify.com/ci-insights/).
3
+ RSpec plugin for [Mergify Test Insights](https://docs.mergify.com/ci-insights/).
4
4
 
5
5
  ## Features
6
6
 
@@ -13,7 +13,7 @@ require_relative 'resources/rspec'
13
13
 
14
14
  module Mergify
15
15
  module RSpec
16
- # Central orchestrator for CI Insights: sets up OpenTelemetry tracing,
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
- # CI Insights formatter when running inside CI.
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 CI Insights'
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 CI Insights and
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 CI Insights is not configured.'
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 ' - CI Insights might not be enabled for this repository'
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/'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-mergify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mergify