[Collab-qa-commits] r1328 - collab-qa-tools/bin
lucas at alioth.debian.org
lucas at alioth.debian.org
Mon Oct 20 06:15:51 UTC 2008
Author: lucas
Date: 2008-10-20 06:15:51 +0000 (Mon, 20 Oct 2008)
New Revision: 1328
Added:
collab-qa-tools/bin/cqa-merge-results
Log:
added cqa-merge-results
Added: collab-qa-tools/bin/cqa-merge-results
===================================================================
--- collab-qa-tools/bin/cqa-merge-results (rev 0)
+++ collab-qa-tools/bin/cqa-merge-results 2008-10-20 06:15:51 UTC (rev 1328)
@@ -0,0 +1,66 @@
+#! /usr/bin/ruby1.8 -w
+
+class Result
+ attr_accessor :version, :result, :time, :guess, :explanation
+ def to_s
+ "#{@version} #{@result} #{@time} #{@guess} #{@explanation}"
+ end
+end
+
+previous = {}
+IO::read(ARGV[0]).each_line do |l|
+ l.chomp!
+ r = Result::new
+ p, r.version, r.result, r.time, r.guess, r.explanation = l.split(' ', 6)
+ if r.explanation.nil?
+ r.explanation = ""
+ end
+ # cleanup old explanations
+ r.explanation.gsub!(/ NEWFAIL$/ ,'')
+ previous[p] = r
+end
+
+IO::read(ARGV[1]).each_line do |l|
+ l.chomp!
+ r = Result::new
+ pkg, r.version, r.result, r.time, r.guess, r.explanation = l.split(' ', 6)
+ r.explanation = "TODO" if r.explanation.nil?
+ if previous[pkg].nil?
+ r.explanation += " NEWFAIL"
+ else
+ prev = previous[pkg]
+ if prev.explanation != "TODO"
+ r.explanation = prev.explanation
+ r.explanation.gsub!(/RECHECK[^\s]*/,'')
+ r.explanation.gsub!(/NEWFAIL/, '')
+ r.explanation.gsub!(/\s+/, ' ')
+ r.explanation += " RECHECK"
+ r.explanation += " RECHECK_VERSION" if r.version != prev.version
+ r.explanation += " RECHECK_GUESS" if r.guess != prev.guess
+ nt = r.time.to_f
+ ot = prev.time.to_f
+ m = [ nt, ot ].min.to_f
+ ratio = (nt - ot).abs.to_f
+ if m < 30
+ p = 1.0
+ elsif m < 100
+ p = 0.6
+ elsif m < 300
+ p = 0.4
+ else
+ p = 0.2
+ end
+ if (ratio/m) >= p
+ r.explanation += " RECHECK_TIME(#{nt.to_i}/#{ot.to_i})"
+ end
+ end
+ previous.delete(pkg)
+ end
+ puts "#{pkg} #{r}"
+end
+File::open('no-longer-fails', 'w') do |f|
+ previous.each_pair do |pkg, val|
+ f.puts pkg + ' ' + val.to_s
+ end
+end
+
More information about the Collab-qa-commits
mailing list