gitlab-org--gitlab-foss/scripts/prune-old-flaky-specs
Rémy Coutable bcb7a99575
Use RspecFlaky::Report in scripts/prune-old-flaky-specs
Signed-off-by: Rémy Coutable <remy@rymai.me>
2018-04-10 15:38:41 +02:00

19 lines
599 B
Ruby
Executable file

#!/usr/bin/env ruby
require_relative '../lib/rspec_flaky/report'
report_file = ARGV.shift
unless report_file
puts 'usage: prune-old-flaky-specs <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 90 days were removed."
puts "Saved #{new_report_file}." if new_report.write(new_report_file)