rspec-mergify 0.0.0.dev → 0.0.1

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: a7709945f85cfa6be7a5f781c7203bd35fae639ccf1da74edef8179f389d3402
4
- data.tar.gz: 55b709a8974c8b0adf74962fe764db5bca1cf11fd173831fab3f3e26e4c21620
3
+ metadata.gz: ea10824d5251a6814614815a6a4810591e4ed3fe0980d731a5cfcf5c834fa6c8
4
+ data.tar.gz: 28ca44cd61f5b92a280b3d4bf946cdd956316b99cc489dd767b28470e4b902b8
5
5
  SHA512:
6
- metadata.gz: 6b52dbb9dbac54154ba8d5ec792305c0ed7a5acd8531dc1786f2d944d4cd6696193d15de72bb7d8c99b102cf1489162ada9e57651d478ce8d3248974037380df
7
- data.tar.gz: 5a30e1df8acd1b0004ba93e87e0e91c91e328442d2136f863bf1d70f11fda53c996b8e74a43465f971eef83a09d2179ca83615ea2d6971ed069f5ec972b3e638
6
+ metadata.gz: 3c7c2a9d250516364d3b051e019d35b97b873ce7dbe8d5200d9aad9f1ef832de1a6d7386f4cb9367fcad35ff66f088bc235bb8123e0b377f3dfb5cee07741985
7
+ data.tar.gz: 2c5d31956e19e4d6c71463b75c26818e89e0e4c2de8cac4d92ca9997b50d87b1195783cfdcf375bcc70fa36a99e544ba91021aaf50e92042469f1eb0e40f31d3
@@ -16,16 +16,6 @@ module Mergify
16
16
  # Add formatter when in CI
17
17
  config.add_formatter(Mergify::RSpec::Formatter) if Utils.in_ci?
18
18
 
19
- # Flaky detection: prepare session with all example IDs
20
- config.before(:suite) do
21
- ci = Mergify::RSpec.ci_insights
22
- fd = ci&.flaky_detector
23
- if fd
24
- all_ids = ::RSpec.world.example_groups.flat_map(&:descendants).flat_map(&:examples).map(&:id)
25
- fd.prepare_for_session(all_ids)
26
- end
27
- end
28
-
29
19
  # Quarantine: mark tests before execution
30
20
  config.before(:each) do |example|
31
21
  ci = Mergify::RSpec.ci_insights
@@ -42,15 +32,6 @@ module Mergify
42
32
 
43
33
  example.run
44
34
 
45
- # Feed metrics from the initial run so the detector can evaluate
46
- if fd
47
- run_time = example.execution_result.run_time || 0.0
48
- status = example.execution_result.status
49
- fd.fill_metrics_from_report(example.id, 'setup', 0.0, status)
50
- fd.fill_metrics_from_report(example.id, 'call', run_time, status)
51
- fd.fill_metrics_from_report(example.id, 'teardown', 0.0, status)
52
- end
53
-
54
35
  next unless fd&.rerunning_test?(example.id)
55
36
 
56
37
  fd.set_test_deadline(example.id)
@@ -189,13 +189,13 @@ module Mergify
189
189
  output.puts report if report
190
190
  end
191
191
 
192
- def flush_and_shutdown # rubocop:disable Metrics/MethodLength
192
+ def flush_and_shutdown
193
193
  return unless @ci_insights&.tracer_provider
194
194
 
195
195
  begin
196
196
  @ci_insights.tracer_provider.force_flush
197
197
  rescue StandardError => e
198
- print_export_error(e)
198
+ output.puts "Error while exporting traces: #{e.message}"
199
199
  end
200
200
 
201
201
  begin
@@ -204,17 +204,6 @@ module Mergify
204
204
  output.puts "Error while shutting down the tracer: #{e.message}"
205
205
  end
206
206
  end
207
-
208
- def print_export_error(error)
209
- output.puts "Error while exporting traces: #{error.message}"
210
- output.puts ''
211
- output.puts 'Common issues:'
212
- 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 ' - There might be a network connectivity issue with the Mergify API'
215
- output.puts ''
216
- output.puts 'Documentation: https://docs.mergify.com/ci-insights/test-frameworks/'
217
- end
218
207
  end
219
208
  # rubocop:enable Metrics/ClassLength
220
209
  end
@@ -2,17 +2,8 @@
2
2
 
3
3
  module Mergify
4
4
  module RSpec
5
- VERSION = begin
6
- v = `git describe --tags --match 'v*' 2>/dev/null`.strip.delete_prefix('v')
7
- if v.empty?
8
- '0.0.0.dev'
9
- elsif v.include?('-')
10
- # e.g. "0.1.0-3-gabc123" -> "0.1.0.dev3"
11
- parts = v.split('-')
12
- "#{parts[0]}.dev#{parts[1]}"
13
- else
14
- v
15
- end
5
+ VERSION = `git describe --tags --match '*' 2>/dev/null`.then do |v|
6
+ v.empty? ? '0.0.0.dev' : v.tr('-', '.')
16
7
  end
17
8
  end
18
9
  end
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.0.dev
4
+ version: 0.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mergify