summaryrefslogtreecommitdiff
path: root/scripts/detect-new-flaky-examples
blob: 3bee4f9a34bb09a8ea2e4cf1e76ca00b12936d82 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env ruby

require 'json'

report_file = ARGV.shift
unless report_file
  puts 'usage: detect-new-flaky-examples <report-file>'
  exit 1
end

puts "Loading #{report_file}..."
report = JSON.parse(File.read(report_file))

if report.any?
  puts "New flaky examples were detected!\n"
  puts JSON.pretty_generate(report)
  exit 1
else
  puts "No new flaky examples detected.\n"
  exit 0
end