Welcome to mirror list, hosted at ThFree Co, Russian Federation.

prune-old-flaky-examples « flaky_examples « scripts - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: fc31f0f699679f9fa7346a18be9832a9a8cb2c3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env ruby
# frozen_string_literal: true

require 'bundler/inline'

gemfile do
  source 'https://rubygems.org'

  gem 'rspec_flaky', path: 'gems/rspec_flaky'
end

report_file = ARGV.shift
unless report_file
  puts "usage: #{__FILE__} <report-file> <new-report-file>"
  exit 1
end

new_report_file = ARGV.shift || report_file
report = RspecFlaky::Report.load(report_file)
puts "Loading #{report_file}..."
puts "Current report has #{report.size} entries."

new_report = report.prune_outdated

puts "New report has #{new_report.size} entries: #{report.size - new_report.size} entries older than " \
     "#{RspecFlaky::Report::OUTDATED_DAYS_THRESHOLD} days were removed."
puts "Saved #{new_report_file}." if new_report.write(new_report_file)