| Server IP : 77.68.64.20 / Your IP : 216.73.216.153 Web Server : Apache System : Linux hp3-wp-1011317.hostingp3.local 3.10.0-1160.144.1.el7.tuxcare.els8.x86_64 #1 SMP Sun Jul 5 17:25:39 UTC 2026 x86_64 User : csh2392878 ( 2033753) PHP Version : 8.3.30 Disable Function : shell_exec,exec,system,popen,set_time_limit MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/share/puppet/ext/autotest/ |
Upload File : |
# vim: syntax=ruby
# From http://pastie.caboo.se/115692, linked from rickbradley
require 'autotest/redgreen'
require 'autotest/timestamp'
Autotest.send(:alias_method, :real_find_files, :find_files)
Autotest.send(:define_method, :find_files) do |*args|
real_find_files.reject do |k, v|
if (ENV['AUTOTEST'] and !ENV['AUTOTEST'].empty?)
!Regexp.new(ENV['AUTOTEST']).match(k)
end
end
end
module Autotest::Growl
def self.growl title, msg, img, pri=0, sticky=""
system "growlnotify -n autotest --image #{img} -p #{pri} -m #{msg.inspect} #{title} #{sticky}"
end
Autotest.add_hook :ran_command do |at|
image_root = "~/.autotest_images"
results = [at.results].flatten.join("\n")
output = results.slice(/(\d+)\stests,\s(\d+)\sassertions,\s(\d+)\sfailures,\s(\d+)\serrors/)
if output
if $~[3].to_i > 0 || $~[4].to_i > 0
growl "FAIL", "#{output}", "#{image_root}/fail.png", 2
else
growl "Pass", "#{output}", "#{image_root}/pass.png"
end
end
output = results.slice(/(\d+)\sexamples,\s(\d+)\sfailures?(,\s+\d+\s+pending)?/)
if output
if $~[2].to_i > 0 || $~[4].to_i > 0
growl "FAIL", "#{output}", "#{image_root}/fail.png", 2
else
growl "Pass", "#{output}", "#{image_root}/pass.png"
end
end
end
end