lib/korinthenkacker/cli.rb in korinthenkacker-0.0.2 vs lib/korinthenkacker/cli.rb in korinthenkacker-0.0.3
- old
+ new
@@ -52,9 +52,17 @@
puts job
failed_scenarios(job, nil)
end
end
+ desc 'verify [JOBS...]', 'exit with 0 if all recent jobs green, exit with 1 if any recent job red'
+ def verify(*jobs)
+ jobs.each do |job|
+ reports = test_reports(job, 1)
+ exit(1) if reports.empty? || !reports.first.success?
+ end
+ end
+
private
def failed_cases_for(jobname, build=nil)
test_reports = build.nil? ? test_reports(jobname, options.limit) : [test_report(jobname, build)]
failed_filter.filter(test_reports.map(&:cases).flatten)