ZenTest 4.0.0 → 4.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +0 -0
- data/.autotest +4 -0
- data/History.txt +22 -0
- data/Manifest.txt +0 -19
- data/README.txt +6 -7
- data/Rakefile +4 -16
- data/bin/unit_diff +1 -2
- data/example_dot_autotest.rb +0 -33
- data/lib/autotest.rb +3 -2
- data/lib/focus.rb +12 -0
- data/lib/multiruby.rb +13 -7
- data/lib/unit_diff.rb +1 -2
- data/lib/zentest.rb +8 -6
- data/test/test_autotest.rb +1 -1
- data/test/test_zentest.rb +16 -13
- metadata +49 -27
- metadata.gz.sig +0 -0
- data/lib/autotest/camping.rb +0 -37
- data/lib/autotest/cctray.rb +0 -57
- data/lib/autotest/discover.rb +0 -6
- data/lib/autotest/emacs.rb +0 -36
- data/lib/autotest/email_notify.rb +0 -66
- data/lib/autotest/fixtures.rb +0 -12
- data/lib/autotest/growl.rb +0 -29
- data/lib/autotest/heckle.rb +0 -14
- data/lib/autotest/html_report.rb +0 -31
- data/lib/autotest/jabber_notify.rb +0 -111
- data/lib/autotest/kdenotify.rb +0 -14
- data/lib/autotest/menu.rb +0 -51
- data/lib/autotest/migrate.rb +0 -7
- data/lib/autotest/notify.rb +0 -34
- data/lib/autotest/pretty.rb +0 -83
- data/lib/autotest/rails.rb +0 -81
- data/lib/autotest/redgreen.rb +0 -21
- data/lib/autotest/shame.rb +0 -45
- data/lib/autotest/snarl.rb +0 -51
metadata
CHANGED
@@ -1,16 +1,37 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ZenTest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Davis
|
8
8
|
- Eric Hodel
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
|
-
cert_chain:
|
11
|
+
cert_chain:
|
12
|
+
- |
|
13
|
+
-----BEGIN CERTIFICATE-----
|
14
|
+
MIIDPjCCAiagAwIBAgIBADANBgkqhkiG9w0BAQUFADBFMRMwEQYDVQQDDApyeWFu
|
15
|
+
ZC1ydWJ5MRkwFwYKCZImiZPyLGQBGRYJemVuc3BpZGVyMRMwEQYKCZImiZPyLGQB
|
16
|
+
GRYDY29tMB4XDTA5MDMwNjE4NTMxNVoXDTEwMDMwNjE4NTMxNVowRTETMBEGA1UE
|
17
|
+
AwwKcnlhbmQtcnVieTEZMBcGCgmSJomT8ixkARkWCXplbnNwaWRlcjETMBEGCgmS
|
18
|
+
JomT8ixkARkWA2NvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALda
|
19
|
+
b9DCgK+627gPJkB6XfjZ1itoOQvpqH1EXScSaba9/S2VF22VYQbXU1xQXL/WzCkx
|
20
|
+
taCPaLmfYIaFcHHCSY4hYDJijRQkLxPeB3xbOfzfLoBDbjvx5JxgJxUjmGa7xhcT
|
21
|
+
oOvjtt5P8+GSK9zLzxQP0gVLS/D0FmoE44XuDr3iQkVS2ujU5zZL84mMNqNB1znh
|
22
|
+
GiadM9GHRaDiaxuX0cIUBj19T01mVE2iymf9I6bEsiayK/n6QujtyCbTWsAS9Rqt
|
23
|
+
qhtV7HJxNKuPj/JFH0D2cswvzznE/a5FOYO68g+YCuFi5L8wZuuM8zzdwjrWHqSV
|
24
|
+
gBEfoTEGr7Zii72cx+sCAwEAAaM5MDcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAw
|
25
|
+
HQYDVR0OBBYEFEfFe9md/r/tj/Wmwpy+MI8d9k/hMA0GCSqGSIb3DQEBBQUAA4IB
|
26
|
+
AQAY59gYvDxqSqgC92nAP9P8dnGgfZgLxP237xS6XxFGJSghdz/nI6pusfCWKM8m
|
27
|
+
vzjjH2wUMSSf3tNudQ3rCGLf2epkcU13/rguI88wO6MrE0wi4ZqLQX+eZQFskJb/
|
28
|
+
w6x9W1ur8eR01s397LSMexySDBrJOh34cm2AlfKr/jokKCTwcM0OvVZnAutaovC0
|
29
|
+
l1SVZ0ecg88bsWHA0Yhh7NFxK1utWoIhtB6AFC/+trM0FQEB/jZkIS8SaNzn96Rl
|
30
|
+
n0sZEf77FLf5peR8TP/PtmIg7Cyqz23sLM4mCOoTGIy5OcZ8TdyiyINUHtb5ej/T
|
31
|
+
FBHgymkyj/AOSqKRIpXPhjC6
|
32
|
+
-----END CERTIFICATE-----
|
12
33
|
|
13
|
-
date: 2009-03
|
34
|
+
date: 2009-06-03 00:00:00 -07:00
|
14
35
|
default_executable:
|
15
36
|
dependencies:
|
16
37
|
- !ruby/object:Gem::Dependency
|
@@ -21,9 +42,27 @@ dependencies:
|
|
21
42
|
requirements:
|
22
43
|
- - ">="
|
23
44
|
- !ruby/object:Gem::Version
|
24
|
-
version:
|
45
|
+
version: 2.0.0
|
25
46
|
version:
|
26
|
-
description:
|
47
|
+
description: |-
|
48
|
+
ZenTest provides 4 different tools: zentest, unit_diff, autotest, and
|
49
|
+
multiruby.
|
50
|
+
|
51
|
+
ZenTest scans your target and unit-test code and writes your missing
|
52
|
+
code based on simple naming rules, enabling XP at a much quicker
|
53
|
+
pace. ZenTest only works with Ruby and Test::Unit. Nobody uses this
|
54
|
+
tool anymore but it is the package namesake, so it stays.
|
55
|
+
|
56
|
+
unit_diff is a command-line filter to diff expected results from
|
57
|
+
actual results and allow you to quickly see exactly what is wrong.
|
58
|
+
|
59
|
+
autotest is a continous testing facility meant to be used during
|
60
|
+
development. As soon as you save a file, autotest will run the
|
61
|
+
corresponding dependent tests.
|
62
|
+
|
63
|
+
multiruby runs anything you want on multiple versions of ruby. Great
|
64
|
+
for compatibility checking! Use multiruby_setup to manage your
|
65
|
+
installed versions.
|
27
66
|
email:
|
28
67
|
- ryand-ruby@zenspider.com
|
29
68
|
- drbrain@segment7.net
|
@@ -63,28 +102,9 @@ files:
|
|
63
102
|
- example_dot_autotest.rb
|
64
103
|
- lib/autotest.rb
|
65
104
|
- lib/autotest/autoupdate.rb
|
66
|
-
- lib/autotest/camping.rb
|
67
|
-
- lib/autotest/cctray.rb
|
68
|
-
- lib/autotest/discover.rb
|
69
|
-
- lib/autotest/emacs.rb
|
70
|
-
- lib/autotest/email_notify.rb
|
71
|
-
- lib/autotest/fixtures.rb
|
72
|
-
- lib/autotest/growl.rb
|
73
|
-
- lib/autotest/heckle.rb
|
74
|
-
- lib/autotest/html_report.rb
|
75
|
-
- lib/autotest/jabber_notify.rb
|
76
|
-
- lib/autotest/kdenotify.rb
|
77
|
-
- lib/autotest/menu.rb
|
78
|
-
- lib/autotest/migrate.rb
|
79
|
-
- lib/autotest/notify.rb
|
80
105
|
- lib/autotest/once.rb
|
81
|
-
- lib/autotest/pretty.rb
|
82
|
-
- lib/autotest/rails.rb
|
83
106
|
- lib/autotest/rcov.rb
|
84
|
-
- lib/autotest/redgreen.rb
|
85
107
|
- lib/autotest/restart.rb
|
86
|
-
- lib/autotest/shame.rb
|
87
|
-
- lib/autotest/snarl.rb
|
88
108
|
- lib/autotest/timestamp.rb
|
89
109
|
- lib/focus.rb
|
90
110
|
- lib/functional_test_matrix.rb
|
@@ -99,6 +119,8 @@ files:
|
|
99
119
|
- test/test_zentest_mapping.rb
|
100
120
|
has_rdoc: true
|
101
121
|
homepage: http://www.zenspider.com/ZSS/Products/ZenTest/
|
122
|
+
licenses: []
|
123
|
+
|
102
124
|
post_install_message:
|
103
125
|
rdoc_options:
|
104
126
|
- --main
|
@@ -120,10 +142,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
120
142
|
requirements: []
|
121
143
|
|
122
144
|
rubyforge_project: zentest
|
123
|
-
rubygems_version: 1.3.
|
145
|
+
rubygems_version: 1.3.4
|
124
146
|
signing_key:
|
125
|
-
specification_version:
|
126
|
-
summary: "ZenTest provides 4 different tools
|
147
|
+
specification_version: 3
|
148
|
+
summary: "ZenTest provides 4 different tools: zentest, unit_diff, autotest, and multiruby"
|
127
149
|
test_files:
|
128
150
|
- test/test_autotest.rb
|
129
151
|
- test/test_focus.rb
|
metadata.gz.sig
ADDED
Binary file
|
data/lib/autotest/camping.rb
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
require 'autotest'
|
2
|
-
|
3
|
-
##
|
4
|
-
# CampingAutotest is an Autotest subclass designed for use with Camping projects.
|
5
|
-
#
|
6
|
-
# To use CampingAutotest pass the -camping flag to autotest.
|
7
|
-
#
|
8
|
-
# Contributed by Geoffrey Grosenbach http://nubyonrails.com
|
9
|
-
|
10
|
-
class Autotest::Camping < Autotest
|
11
|
-
|
12
|
-
def initialize # :nodoc:
|
13
|
-
super
|
14
|
-
@exceptions = %r%\.(log|db)$%
|
15
|
-
|
16
|
-
@test_mappings = {
|
17
|
-
%r%^test/fixtures/([^_]+)_.*s\.yml% => proc { |_, m|
|
18
|
-
"test/#{m[1]}_test.rb"
|
19
|
-
},
|
20
|
-
%r%^test/.*rb$% => proc { |filename, m|
|
21
|
-
filename
|
22
|
-
},
|
23
|
-
%r%^public/([^\/]+)/(models|controllers|views)\.rb$% => proc { |_, m|
|
24
|
-
"test/#{m[1]}_test.rb"
|
25
|
-
},
|
26
|
-
%r%^public/(.*)\.rb$% => proc { |_, m|
|
27
|
-
"test/#{m[1]}_test.rb"
|
28
|
-
},
|
29
|
-
}
|
30
|
-
|
31
|
-
return functional_tests
|
32
|
-
end
|
33
|
-
|
34
|
-
def tests_for_file(filename)
|
35
|
-
super.select { |f| @files.has_key? f }
|
36
|
-
end
|
37
|
-
end
|
data/lib/autotest/cctray.rb
DELETED
@@ -1,57 +0,0 @@
|
|
1
|
-
# -*- ruby -*-
|
2
|
-
|
3
|
-
require 'fileutils'
|
4
|
-
|
5
|
-
module Autotest::CCTray
|
6
|
-
MAX = 30
|
7
|
-
STATUS = {
|
8
|
-
:all_good => "Success",
|
9
|
-
:green => "Success",
|
10
|
-
:red => "Failure",
|
11
|
-
}
|
12
|
-
DIR = File.expand_path("~/Sites/dashboard")
|
13
|
-
|
14
|
-
def self.project_name= name
|
15
|
-
@@project_name = name
|
16
|
-
end
|
17
|
-
|
18
|
-
def self.update_status status
|
19
|
-
dir = File.join(DIR, @@project_name)
|
20
|
-
serial = Time.now.to_i
|
21
|
-
file = "status.#{serial}.xml"
|
22
|
-
FileUtils.mkdir_p dir
|
23
|
-
Dir.chdir dir do
|
24
|
-
File.open(file, 'w') do |f|
|
25
|
-
f.puts %(<Project name="#{@@project_name}" activity="Sleeping" lastBuildStatus="#{STATUS[status]}" lastBuildLabel="build.#{serial}" lastBuildTime="#{Time.now.xmlschema}" webUrl="http://localhost/~ryan/dashboard/#{@@project_name}/"/>)
|
26
|
-
end
|
27
|
-
files = Dir["*.xml"].sort_by { |f| File.mtime f }.reverse
|
28
|
-
(files - files.first(MAX)).each do |f|
|
29
|
-
File.unlink f
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
Dir.chdir DIR do
|
34
|
-
new_file = "cctray.xml.#{$$}"
|
35
|
-
old_file = "cctray.xml"
|
36
|
-
File.open(from_file, "w") do |out|
|
37
|
-
out.puts "<Projects>"
|
38
|
-
Dir["*"].each do |d|
|
39
|
-
next unless File.directory? d
|
40
|
-
Dir.chdir d do
|
41
|
-
latest = Dir["*.xml"].sort_by { |f| File.mtime f }.last
|
42
|
-
out.puts File.read(latest)
|
43
|
-
end
|
44
|
-
end
|
45
|
-
out.puts "</Projects>"
|
46
|
-
end
|
47
|
-
File.rename new_file, old_file
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
[:run, :red, :green, :all_good].each do |status|
|
52
|
-
Autotest.add_hook status do |at|
|
53
|
-
STATUS[Time.now] = at.files_to_test.size
|
54
|
-
update_status status
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
data/lib/autotest/discover.rb
DELETED
data/lib/autotest/emacs.rb
DELETED
@@ -1,36 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# Get autotest.el from http://www.emacswiki.org/cgi-bin/wiki/RyanDavis
|
3
|
-
#
|
4
|
-
|
5
|
-
module Autotest::Emacs
|
6
|
-
@@client_cmd = 'emacsclient -e'
|
7
|
-
|
8
|
-
def self.command= o
|
9
|
-
@@client_cmd = o
|
10
|
-
end
|
11
|
-
|
12
|
-
def self.emacs_autotest status
|
13
|
-
`#{@@client_cmd} \"(autotest-update '#{status})\"`
|
14
|
-
nil
|
15
|
-
end
|
16
|
-
|
17
|
-
Autotest.add_hook :run_command do |at|
|
18
|
-
emacs_autotest :running
|
19
|
-
end
|
20
|
-
|
21
|
-
Autotest.add_hook :green do |at|
|
22
|
-
emacs_autotest :passed
|
23
|
-
end
|
24
|
-
|
25
|
-
Autotest.add_hook :all_good do |at|
|
26
|
-
emacs_autotest :passed
|
27
|
-
end
|
28
|
-
|
29
|
-
Autotest.add_hook :red do |at|
|
30
|
-
emacs_autotest :failed
|
31
|
-
end
|
32
|
-
|
33
|
-
Autotest.add_hook :quit do |at|
|
34
|
-
emacs_autotest :quit
|
35
|
-
end
|
36
|
-
end
|
@@ -1,66 +0,0 @@
|
|
1
|
-
require 'net/smtp'
|
2
|
-
|
3
|
-
module Autotest::EmailNotify
|
4
|
-
@@smtp_settings = ['localhost']
|
5
|
-
@@from = nil
|
6
|
-
@@recipients = []
|
7
|
-
@@use_svn = true
|
8
|
-
@@report_every_run = false
|
9
|
-
|
10
|
-
@@last_rev = nil
|
11
|
-
|
12
|
-
def self.smtp_settings= o
|
13
|
-
@@smtp_settings = o
|
14
|
-
end
|
15
|
-
|
16
|
-
def self.from= o
|
17
|
-
@@from = o
|
18
|
-
end
|
19
|
-
|
20
|
-
def self.recipients= o
|
21
|
-
@@recipients = o
|
22
|
-
end
|
23
|
-
|
24
|
-
def self.use_svn= o
|
25
|
-
@@use_svn = o
|
26
|
-
end
|
27
|
-
|
28
|
-
def self.report_every_run= o
|
29
|
-
@@report_every_run = o
|
30
|
-
end
|
31
|
-
|
32
|
-
def self.notify title, msg
|
33
|
-
@@recipients.each do |to|
|
34
|
-
body = ["From: autotest <#{@@from}>"]
|
35
|
-
body << "To: <#{to}>"
|
36
|
-
body << "Subject: #{title}"
|
37
|
-
body << "\n"
|
38
|
-
body << msg
|
39
|
-
Net::SMTP.start(*@@smtp_settings) do |smtp|
|
40
|
-
smtp.send_message body.join("\n"), @@from, to
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
def self.svn_release
|
46
|
-
if @@use_svn
|
47
|
-
rev = `svn info`.match(/Revision: (\d+)/)[1]
|
48
|
-
return "r#{rev} "
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
Autotest.add_hook :ran_command do |at|
|
53
|
-
rev = self.svn_release
|
54
|
-
if @@report_every_run or rev != @@last_rev
|
55
|
-
@@last_rev = rev
|
56
|
-
output = at.results.join
|
57
|
-
failed = output.scan(/^\s+\d+\) (?:Failure|Error):\n(.*?)\((.*?)\)/)
|
58
|
-
if failed.size == 0 then
|
59
|
-
notify "#{rev}Tests Passed", output
|
60
|
-
else
|
61
|
-
f,e = failed.partition { |s| s =~ /Failure/ }
|
62
|
-
notify "#{rev}#{failed.size} Tests Failed", output
|
63
|
-
end
|
64
|
-
end
|
65
|
-
end
|
66
|
-
end
|
data/lib/autotest/fixtures.rb
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
# -*- ruby -*-
|
2
|
-
|
3
|
-
# This is an example of how to change the mappings of file that
|
4
|
-
# changed to tests to run for a project.
|
5
|
-
|
6
|
-
module Autotest::Fixtures
|
7
|
-
Autotest.add_hook :initialize do |at|
|
8
|
-
at.test_mappings['^test/fixtures/(.*)s.yml'] = proc { |filename, matches|
|
9
|
-
at.files_matching(/test\/\w+\/#{matches[1]}(_\w+)?.*_test.rb$/)
|
10
|
-
}
|
11
|
-
end
|
12
|
-
end
|
data/lib/autotest/growl.rb
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
# -*- ruby -*-
|
2
|
-
|
3
|
-
module Autotest::Growl
|
4
|
-
def self.growl title, msg, pri = 0, img = nil
|
5
|
-
title += " in #{Dir.pwd.split(/\//).last(3).join("/")}"
|
6
|
-
msg += " at #{Time.now.strftime('%Y-%m-%d %H:%M:%S')}"
|
7
|
-
# TODO: parameterize default image
|
8
|
-
img ||= "/Applications/Mail.app/Contents/Resources/Caution.tiff"
|
9
|
-
cmd = "growlnotify -w -n autotest --image #{img} -p #{pri} -m #{msg.inspect} #{title}"
|
10
|
-
system cmd
|
11
|
-
nil
|
12
|
-
end
|
13
|
-
|
14
|
-
Autotest.add_hook :initialize do |at|
|
15
|
-
growl "autotest running", "Started"
|
16
|
-
end
|
17
|
-
|
18
|
-
Autotest.add_hook :red do |at|
|
19
|
-
growl "Tests Failed", "#{at.files_to_test.size} tests failed", 2
|
20
|
-
end
|
21
|
-
|
22
|
-
Autotest.add_hook :green do |at|
|
23
|
-
growl "Tests Passed", "Tests passed", -2 if at.tainted
|
24
|
-
end
|
25
|
-
|
26
|
-
Autotest.add_hook :all_good do |at|
|
27
|
-
growl "Tests Passed", "All tests passed", -2 if at.tainted
|
28
|
-
end
|
29
|
-
end
|
data/lib/autotest/heckle.rb
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
# -*- ruby -*-
|
2
|
-
|
3
|
-
module Autotest::Heckle
|
4
|
-
@@flags = []
|
5
|
-
@@klasses = []
|
6
|
-
def self.flags; @@flags; end
|
7
|
-
def self.klasses; @@klasses; end
|
8
|
-
|
9
|
-
Autotest.add_hook :all_good do |at|
|
10
|
-
heckle = "heckle" + (@@flags.empty? ? '' : " #{flags.join(' ')}")
|
11
|
-
cmd = @@klasses.map { |klass| "#{heckle} #{klass}" }.join(" && ")
|
12
|
-
system cmd
|
13
|
-
end
|
14
|
-
end
|
data/lib/autotest/html_report.rb
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
# -*- mode -*-
|
2
|
-
|
3
|
-
module Autotest::HtmlConsole
|
4
|
-
MAX = 30
|
5
|
-
STATUS = {}
|
6
|
-
PATH = File.expand_path("~/Sites/autotest.html")
|
7
|
-
|
8
|
-
def self.update
|
9
|
-
STATUS.delete STATUS.keys.sort.last if STATUS.size > MAX
|
10
|
-
File.open(PATH, "w") do |f|
|
11
|
-
f.puts "<title>Autotest Status</title>"
|
12
|
-
STATUS.sort.reverse.each do |t,s|
|
13
|
-
if s > 0 then
|
14
|
-
f.puts "<p style=\"color:red\">#{t}: #{s}"
|
15
|
-
else
|
16
|
-
f.puts "<p style=\"color:green\">#{t}: #{s}"
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
Autotest.add_hook :red do |at|
|
23
|
-
STATUS[Time.now] = at.files_to_test.size
|
24
|
-
update
|
25
|
-
end
|
26
|
-
|
27
|
-
Autotest.add_hook :green do |at|
|
28
|
-
STATUS[Time.now] = 0
|
29
|
-
update
|
30
|
-
end
|
31
|
-
end
|
@@ -1,111 +0,0 @@
|
|
1
|
-
begin; require 'rubygems'; rescue LoadError; end
|
2
|
-
require 'xmpp4r-simple'
|
3
|
-
|
4
|
-
module Autotest::JabberNotify
|
5
|
-
@@recipients = []
|
6
|
-
@@account = nil
|
7
|
-
@@password = nil
|
8
|
-
@@use_svn = true
|
9
|
-
@@report_every_run = true
|
10
|
-
|
11
|
-
@@im = nil
|
12
|
-
@@last_rev = nil
|
13
|
-
@@green = false
|
14
|
-
|
15
|
-
def self.recipients= o
|
16
|
-
@@recipients = o
|
17
|
-
end
|
18
|
-
|
19
|
-
def self.account= o
|
20
|
-
@@account = o
|
21
|
-
end
|
22
|
-
|
23
|
-
def self.password= o
|
24
|
-
@@password = o
|
25
|
-
end
|
26
|
-
|
27
|
-
def self.use_svn= o
|
28
|
-
@@use_svn = o
|
29
|
-
end
|
30
|
-
|
31
|
-
def self.report_every_run= o
|
32
|
-
@@report_every_run = o
|
33
|
-
end
|
34
|
-
|
35
|
-
def self.im
|
36
|
-
unless @@im
|
37
|
-
puts "# creating im client"
|
38
|
-
@@im = Jabber::Simple.new(@@account,@@password)
|
39
|
-
sleep(2) # need this or else the first announcement may cause an error
|
40
|
-
end
|
41
|
-
if !@@im.connected?
|
42
|
-
puts "# reconnecting to #{@@account}"
|
43
|
-
@@im.reconnect
|
44
|
-
end
|
45
|
-
@@im
|
46
|
-
end
|
47
|
-
|
48
|
-
def self.notify(msg)
|
49
|
-
@@recipients.each do |contact|
|
50
|
-
self.im.deliver(contact, msg)
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
def self.status(status)
|
55
|
-
rev = self.svn_release
|
56
|
-
status = "#{rev}#{status}"
|
57
|
-
self.im.status(:chat, status)
|
58
|
-
end
|
59
|
-
|
60
|
-
def self.svn_release
|
61
|
-
if @@use_svn
|
62
|
-
rev = `svn info`.match(/Revision: (\d+)/)[1]
|
63
|
-
return "r#{rev} "
|
64
|
-
end
|
65
|
-
end
|
66
|
-
|
67
|
-
# hooks
|
68
|
-
|
69
|
-
Autotest.add_hook :run do |at|
|
70
|
-
notify "autotest started"
|
71
|
-
end
|
72
|
-
|
73
|
-
Autotest.add_hook :run_command do |at|
|
74
|
-
status "testing"
|
75
|
-
end
|
76
|
-
|
77
|
-
Autotest.add_hook :ran_command do |at|
|
78
|
-
rev = self.svn_release
|
79
|
-
if @@report_every_run or rev != @@last_rev
|
80
|
-
@@last_rev = rev
|
81
|
-
output = at.results.join
|
82
|
-
failed = output.scan(/^\s+\d+\) ((?:Failure|Error):\n.*?\.*?\))/).flatten
|
83
|
-
failed.map! {|f| f.gsub!(/\n/,' '); f.gsub(/^/,'- ') }
|
84
|
-
time = output.scan(/Finished in (.*?)\n/)
|
85
|
-
if failed.size > 0 then
|
86
|
-
notify "Tests Passed\n#{time}\n" if !@@green
|
87
|
-
@@green = true # prevent repeat success notifications
|
88
|
-
else
|
89
|
-
@@green = false
|
90
|
-
notify "#{failed.size} Tests Failed\n" + failed.join("\n")
|
91
|
-
end
|
92
|
-
end
|
93
|
-
end
|
94
|
-
|
95
|
-
Autotest.add_hook :green do |at|
|
96
|
-
status "Tests Pass"
|
97
|
-
end
|
98
|
-
|
99
|
-
Autotest.add_hook :red do |at|
|
100
|
-
status "Tests Failed"
|
101
|
-
end
|
102
|
-
|
103
|
-
Autotest.add_hook :quit do |at|
|
104
|
-
notify "autotest is exiting"
|
105
|
-
self.im.disconnect
|
106
|
-
end
|
107
|
-
|
108
|
-
Autotest.add_hook :all do |at|_hook
|
109
|
-
notify "Tests have fully passed" unless $TESTING
|
110
|
-
end
|
111
|
-
end
|