cerberus 0.4.1 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGES +6 -0
- data/Rakefile +1 -1
- data/lib/cerberus/builder/rspec.rb +15 -1
- data/lib/cerberus/builder/ruby_base.rb +3 -13
- data/lib/cerberus/constants.rb +1 -1
- data/lib/cerberus/publisher/rss.rb +2 -0
- data/test/bjam_builder_test.rb +0 -0
- data/test/config_test.rb +0 -0
- data/test/functional_test.rb +0 -0
- data/test/integration_test.rb +0 -0
- data/test/irc_publisher_test.rb +0 -0
- data/test/jabber_publisher_test.rb +0 -0
- data/test/mail_publisher_test.rb +0 -0
- data/test/maven2_builer_test.rb +0 -0
- data/test/mock/manager.rb +25 -1
- data/test/perforce_scm_test.rb +0 -0
- data/test/rspec_builder_test.rb +100 -0
- data/test/rss_publisher_test.rb +1 -0
- data/test/test_helper.rb +2 -1
- data/test/twitter_publisher_test.rb +0 -0
- metadata +50 -48
data/CHANGES
CHANGED
data/Rakefile
CHANGED
@@ -158,7 +158,7 @@ task :www => :webgen
|
|
158
158
|
end
|
159
159
|
|
160
160
|
task :publish_site => :webgen do
|
161
|
-
sh %{scp -r -q doc/site/
|
161
|
+
sh %{scp -r -q doc/site/out/* #{RUBYFORGE_USER}@rubyforge.org:/var/www/gforge-projects/#{RUBYFORGE_PROJECT}/}
|
162
162
|
end
|
163
163
|
|
164
164
|
task :release => [:release_files, :publish_news, :publish_site]
|
@@ -5,9 +5,23 @@ class Cerberus::Builder::RSpec < Cerberus::Builder::RubyBase
|
|
5
5
|
super(config, "rspec", "spec")
|
6
6
|
end
|
7
7
|
|
8
|
+
def run
|
9
|
+
Dir.chdir @config[:application_root]
|
10
|
+
@output = if @config[:builder, @name.to_sym, :task]
|
11
|
+
`#{@config[:bin_path]}rake #{@config[:builder, @name.to_sym, :task]} 2>&1`
|
12
|
+
else
|
13
|
+
`#{@config[:bin_path]}rake #{choose_exec()} 2>&1`
|
14
|
+
end
|
15
|
+
successful?
|
16
|
+
end
|
17
|
+
|
8
18
|
def brokeness
|
9
|
-
if @output =~ /\d+ examples, (\d+) failures
|
19
|
+
if @output =~ /\d+ examples, (\d+) failures?/
|
10
20
|
$1.to_i
|
11
21
|
end
|
12
22
|
end
|
23
|
+
|
24
|
+
def successful?
|
25
|
+
$?.exitstatus == 0 and not @output.include?("#{@cmd} aborted!") and @output.include?("0 failures")
|
26
|
+
end
|
13
27
|
end
|
@@ -16,22 +16,12 @@ class Cerberus::Builder::RubyBase
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def successful?
|
19
|
-
|
20
|
-
$?.exitstatus == 0 and not @output.include?("#{@cmd} aborted!") and @output.include?("0 failures, 0 errors")
|
21
|
-
else
|
22
|
-
$?.exitstatus == 0 and not @output.include?("#{@cmd} aborted!") and @output.include?("0 failures")
|
23
|
-
end
|
19
|
+
$?.exitstatus == 0 and not @output.include?("#{@cmd} aborted!") and @output.include?("0 failures, 0 errors")
|
24
20
|
end
|
25
21
|
|
26
22
|
def brokeness
|
27
|
-
if @output
|
28
|
-
|
29
|
-
return $1.to_i + $2.to_i
|
30
|
-
end
|
31
|
-
else
|
32
|
-
if @output =~ /\d+ examples, (\d+) failures, 1 pending/
|
33
|
-
return $1.to_i
|
34
|
-
end
|
23
|
+
if @output =~ /\d+ tests, \d+ assertions, (\d+) failures, (\d+) errors/
|
24
|
+
return $1.to_i + $2.to_i
|
35
25
|
end
|
36
26
|
end
|
37
27
|
|
data/lib/cerberus/constants.rb
CHANGED
data/test/bjam_builder_test.rb
CHANGED
File without changes
|
data/test/config_test.rb
CHANGED
File without changes
|
data/test/functional_test.rb
CHANGED
File without changes
|
data/test/integration_test.rb
CHANGED
File without changes
|
data/test/irc_publisher_test.rb
CHANGED
File without changes
|
File without changes
|
data/test/mail_publisher_test.rb
CHANGED
File without changes
|
data/test/maven2_builer_test.rb
CHANGED
File without changes
|
data/test/mock/manager.rb
CHANGED
@@ -8,4 +8,28 @@ class DummyManager
|
|
8
8
|
@scm = DummyScm.new(last_commit_message, current_revision, last_author)
|
9
9
|
@builder = DummyBuilder.new(output)
|
10
10
|
end
|
11
|
-
end
|
11
|
+
end
|
12
|
+
|
13
|
+
class DummyStatus
|
14
|
+
attr_reader :previous_brokeness, :current_brokeness
|
15
|
+
|
16
|
+
def initialize(param)
|
17
|
+
@hash = param
|
18
|
+
@current_build_sucessful = @hash['state']
|
19
|
+
@previous_build_successful = @hash['previous_build'] || false
|
20
|
+
@previous_brokeness = @hash['previous_brokeness'] || ''
|
21
|
+
@current_brokeness = @hash['current_brokeness'] || ''
|
22
|
+
end
|
23
|
+
|
24
|
+
def current_state
|
25
|
+
if @current_build_successful
|
26
|
+
if @previous_build_sucessful.nil?
|
27
|
+
:setup
|
28
|
+
else
|
29
|
+
@previous_build_successful ? :successful : :revival
|
30
|
+
end
|
31
|
+
else
|
32
|
+
@previous_build_successful ? :failed : :broken
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
data/test/perforce_scm_test.rb
CHANGED
File without changes
|
@@ -0,0 +1,100 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/test_helper'
|
2
|
+
|
3
|
+
require 'cerberus/builder/rspec'
|
4
|
+
require 'tmpdir'
|
5
|
+
|
6
|
+
class Cerberus::Builder::RSpec
|
7
|
+
attr_writer :output
|
8
|
+
end
|
9
|
+
|
10
|
+
class RSpecBuilderTest < Test::Unit::TestCase
|
11
|
+
def test_builder
|
12
|
+
tmp = Dir::tmpdir
|
13
|
+
builder = Cerberus::Builder::RSpec.new(:application_root => tmp)
|
14
|
+
|
15
|
+
builder.output = RSPEC_TEST_OK_OUTPUT
|
16
|
+
assert builder.successful?
|
17
|
+
|
18
|
+
builder.output = RSPEC_TEST_OK_OUTPUT_WITH_PENDING
|
19
|
+
assert builder.successful?
|
20
|
+
|
21
|
+
builder.output = RSPEC_TEST_ERROR_OUTPUT
|
22
|
+
assert !builder.successful?
|
23
|
+
assert_equal 1, builder.brokeness
|
24
|
+
|
25
|
+
builder.output = RSPEC_TEST_ERROR_OUTPUT_WITH_PENDING
|
26
|
+
assert !builder.successful?
|
27
|
+
assert_equal 1, builder.brokeness
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
RSPEC_TEST_OK_OUTPUT =<<-END
|
32
|
+
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby /Library/Ruby/Gems/1.8/gems/rspec-1.1.12/bin/spec spec/views/clients/show.html.erb_spec.rb spec/models/role_spec.rb spec/models/dashboard_spec.rb spec/models/client_spec.rb spec/helpers/admin/users_helper_spec.rb spec/controllers/sessions_controller_spec.rb spec/models/query_dates_spec.rb spec/helpers/heatmaps_helper_spec.rb spec/helpers/passwords_helper_spec.rb spec/controllers/admin/reports_controller_spec.rb spec/models/role_assignment_spec.rb spec/models/default_role_spec.rb spec/controllers/sites_controller_spec.rb spec/controllers/dashboards_controller_spec.rb spec/models/widget_instance_spec.rb spec/models/widget_spec.rb spec/controllers/admin/roles_controller_spec.rb spec/models/user_spec.rb spec/models/right_spec.rb spec/views/clients/new.html.erb_spec.rb spec/helpers/reports_helper_spec.rb spec/controllers/reports_controller_spec.rb spec/models/site_spec.rb spec/helpers/admin/rights_helper_spec.rb spec/models/data_warehouse_spec.rb spec/helpers/users_helper_spec.rb spec/helpers/clients_helper_spec.rb spec/helpers/admin/roles_helper_spec.rb spec/views/clients/index.html.erb_spec.rb spec/controllers/users_controller_spec.rb spec/controllers/clients_routing_spec.rb spec/controllers/clients_controller_spec.rb spec/controllers/admin/users_controller_spec.rb spec/controllers/access_control_spec.rb spec/models/query_cache_key_spec.rb spec/views/clients/edit.html.erb_spec.rb spec/controllers/passwords_controller_spec.rb spec/controllers/authenticated_system_spec.rb spec/helpers/application_helper_spec.rb spec/models/report_spec.rb spec/models/query_spec.rb spec/helpers/admin/reports_helper_spec.rb spec/controllers/queries_controller_spec.rb spec/controllers/application_controller_spec.rb spec/models/excel_export_spec.rb spec/controllers/admin/rights_controller_spec.rb -O spec/spec.opts
|
33
|
+
..............................................................................................................................................................................................................................................*....*..................................................................................................................................................................................................................*.................................................................................................................*..*....*.................................................................................................................................................................................................
|
34
|
+
|
35
|
+
Pending:
|
36
|
+
|
37
|
+
SessionsController logout_keeping_session! forgets me (Not Yet Implemented)
|
38
|
+
/src/parkassist/paseweb/vendor/gems/rspec-rails-1.1.12/lib/spec/rails/example/controller_example_group.rb:109:in `initialize'
|
39
|
+
|
40
|
+
SessionsController logout_killing_session! forgets me (Not Yet Implemented)
|
41
|
+
/src/parkassist/paseweb/vendor/gems/rspec-rails-1.1.12/lib/spec/rails/example/controller_example_group.rb:109:in `initialize'
|
42
|
+
|
43
|
+
Report query_data should return a hash of all queries via :dom_id => :data (TODO)
|
44
|
+
./spec/models/report_spec.rb:109
|
45
|
+
|
46
|
+
ReportsController GET show xls format request should return an excel spreadsheet (TODO)
|
47
|
+
./spec/controllers/reports_controller_spec.rb:56
|
48
|
+
|
49
|
+
ReportsController GET show should query the DataWarehouse (TODO)
|
50
|
+
./spec/controllers/reports_controller_spec.rb:39
|
51
|
+
|
52
|
+
DashboardsController it should save user-customized layout should check access before saving (TODO)
|
53
|
+
./spec/controllers/dashboards_controller_spec.rb:280
|
54
|
+
|
55
|
+
Finished in 41.688393 seconds
|
56
|
+
|
57
|
+
770 examples, 0 failures, 6 pending
|
58
|
+
END
|
59
|
+
|
60
|
+
RSPEC_TEST_OK_OUTPUT_WITH_PENDING =<<-END
|
61
|
+
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby /Library/Ruby/Gems/1.8/gems/rspec-1.1.12/bin/spec spec/views/clients/show.html.erb_spec.rb spec/models/role_spec.rb spec/models/dashboard_spec.rb spec/models/client_spec.rb spec/helpers/admin/users_helper_spec.rb spec/controllers/sessions_controller_spec.rb spec/models/query_dates_spec.rb spec/helpers/heatmaps_helper_spec.rb spec/helpers/passwords_helper_spec.rb spec/controllers/admin/reports_controller_spec.rb spec/models/role_assignment_spec.rb spec/models/default_role_spec.rb spec/controllers/sites_controller_spec.rb spec/controllers/dashboards_controller_spec.rb spec/models/widget_instance_spec.rb spec/models/widget_spec.rb spec/controllers/admin/roles_controller_spec.rb spec/models/user_spec.rb spec/models/right_spec.rb spec/views/clients/new.html.erb_spec.rb spec/helpers/reports_helper_spec.rb spec/controllers/reports_controller_spec.rb spec/models/site_spec.rb spec/helpers/admin/rights_helper_spec.rb spec/models/data_warehouse_spec.rb spec/helpers/users_helper_spec.rb spec/helpers/clients_helper_spec.rb spec/helpers/admin/roles_helper_spec.rb spec/views/clients/index.html.erb_spec.rb spec/controllers/users_controller_spec.rb spec/controllers/clients_routing_spec.rb spec/controllers/clients_controller_spec.rb spec/controllers/admin/users_controller_spec.rb spec/controllers/access_control_spec.rb spec/models/query_cache_key_spec.rb spec/views/clients/edit.html.erb_spec.rb spec/controllers/passwords_controller_spec.rb spec/controllers/authenticated_system_spec.rb spec/helpers/application_helper_spec.rb spec/models/report_spec.rb spec/models/query_spec.rb spec/helpers/admin/reports_helper_spec.rb spec/controllers/queries_controller_spec.rb spec/controllers/application_controller_spec.rb spec/models/excel_export_spec.rb spec/controllers/admin/rights_controller_spec.rb -O spec/spec.opts
|
62
|
+
............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
|
63
|
+
|
64
|
+
Finished in 23.895298 seconds
|
65
|
+
|
66
|
+
764 examples, 0 failures
|
67
|
+
END
|
68
|
+
|
69
|
+
RSPEC_TEST_ERROR_OUTPUT =<<-END
|
70
|
+
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby /Library/Ruby/Gems/1.8/gems/rspec-1.1.12/bin/spec spec/models/site_spec.rb -O spec/spec.opts
|
71
|
+
...........F...
|
72
|
+
|
73
|
+
1)
|
74
|
+
'Site being created increments Site#count' FAILED
|
75
|
+
count should not have changed, but did change from 1 to 2
|
76
|
+
./spec/models/site_spec.rb:21:
|
77
|
+
|
78
|
+
Finished in 0.433946 seconds
|
79
|
+
|
80
|
+
15 examples, 1 failure
|
81
|
+
END
|
82
|
+
|
83
|
+
RSPEC_TEST_ERROR_OUTPUT_WITH_PENDING =<<-END
|
84
|
+
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby /Library/Ruby/Gems/1.8/gems/rspec-1.1.12/bin/spec spec/models/site_spec.rb -O spec/spec.opts
|
85
|
+
...........F..*
|
86
|
+
|
87
|
+
Pending:
|
88
|
+
|
89
|
+
Site should respond to :client (TODO)
|
90
|
+
./spec/models/site_spec.rb:31
|
91
|
+
|
92
|
+
1)
|
93
|
+
'Site being created increments Site#count' FAILED
|
94
|
+
count should not have changed, but did change from 1 to 2
|
95
|
+
./spec/models/site_spec.rb:21:
|
96
|
+
|
97
|
+
Finished in 0.245002 seconds
|
98
|
+
|
99
|
+
15 examples, 1 failure, 1 pending
|
100
|
+
END
|
data/test/rss_publisher_test.rb
CHANGED
data/test/test_helper.rb
CHANGED
@@ -5,6 +5,7 @@ require 'test/unit'
|
|
5
5
|
require 'fileutils'
|
6
6
|
|
7
7
|
require 'cerberus/utils'
|
8
|
+
require 'mock/manager'
|
8
9
|
|
9
10
|
class Test::Unit::TestCase
|
10
11
|
TEMP_DIR = File.expand_path(File.dirname(__FILE__)) + '/__workdir'
|
@@ -110,7 +111,7 @@ end"
|
|
110
111
|
end
|
111
112
|
|
112
113
|
def build_status(successful)
|
113
|
-
|
114
|
+
DummyStatus.new('state' => successful)
|
114
115
|
end
|
115
116
|
end
|
116
117
|
|
File without changes
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cerberus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anatol Pomozov
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-01-
|
12
|
+
date: 2009-01-26 00:00:00 -05:00
|
13
13
|
default_executable: cerberus
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -93,61 +93,62 @@ extra_rdoc_files: []
|
|
93
93
|
files:
|
94
94
|
- bin/cerberus
|
95
95
|
- lib/cerberus
|
96
|
-
- lib/cerberus/
|
96
|
+
- lib/cerberus/builder
|
97
|
+
- lib/cerberus/builder/base.rb
|
98
|
+
- lib/cerberus/builder/bjam.rb
|
99
|
+
- lib/cerberus/builder/maven2.rb
|
100
|
+
- lib/cerberus/builder/rake.rb
|
101
|
+
- lib/cerberus/builder/rant.rb
|
102
|
+
- lib/cerberus/builder/rspec.rb
|
103
|
+
- lib/cerberus/builder/ruby_base.rb
|
104
|
+
- lib/cerberus/cli.rb
|
97
105
|
- lib/cerberus/component_lazy_loader.rb
|
106
|
+
- lib/cerberus/config.example.yml
|
107
|
+
- lib/cerberus/config.rb
|
98
108
|
- lib/cerberus/config_migration.rb
|
109
|
+
- lib/cerberus/constants.rb
|
110
|
+
- lib/cerberus/latch.rb
|
111
|
+
- lib/cerberus/manager.rb
|
99
112
|
- lib/cerberus/publisher
|
100
|
-
- lib/cerberus/publisher/
|
113
|
+
- lib/cerberus/publisher/base.rb
|
114
|
+
- lib/cerberus/publisher/campfire.rb
|
101
115
|
- lib/cerberus/publisher/gmailer.rb
|
116
|
+
- lib/cerberus/publisher/irc.rb
|
117
|
+
- lib/cerberus/publisher/jabber.rb
|
118
|
+
- lib/cerberus/publisher/mail.rb
|
102
119
|
- lib/cerberus/publisher/netsmtp_tls_fix.rb
|
103
|
-
- lib/cerberus/publisher/campfire.rb
|
104
120
|
- lib/cerberus/publisher/rss.rb
|
105
|
-
- lib/cerberus/publisher/base.rb
|
106
121
|
- lib/cerberus/publisher/twitter.rb
|
107
|
-
- lib/cerberus/publisher/irc.rb
|
108
|
-
- lib/cerberus/publisher/jabber.rb
|
109
|
-
- lib/cerberus/builder
|
110
|
-
- lib/cerberus/builder/ruby_base.rb
|
111
|
-
- lib/cerberus/builder/rspec.rb
|
112
|
-
- lib/cerberus/builder/bjam.rb
|
113
|
-
- lib/cerberus/builder/rant.rb
|
114
|
-
- lib/cerberus/builder/base.rb
|
115
|
-
- lib/cerberus/builder/maven2.rb
|
116
|
-
- lib/cerberus/builder/rake.rb
|
117
|
-
- lib/cerberus/config.rb
|
118
122
|
- lib/cerberus/scm
|
123
|
+
- lib/cerberus/scm/cvs.rb
|
124
|
+
- lib/cerberus/scm/darcs.rb
|
119
125
|
- lib/cerberus/scm/git.rb
|
120
|
-
- lib/cerberus/scm/svn.rb
|
121
126
|
- lib/cerberus/scm/perforce.rb
|
122
|
-
- lib/cerberus/scm/
|
123
|
-
- lib/cerberus/scm/cvs.rb
|
124
|
-
- lib/cerberus/latch.rb
|
127
|
+
- lib/cerberus/scm/svn.rb
|
125
128
|
- lib/cerberus/utils.rb
|
126
|
-
- lib/cerberus/constants.rb
|
127
|
-
- lib/cerberus/manager.rb
|
128
|
-
- lib/cerberus/cli.rb
|
129
|
-
- test/integration_test.rb
|
130
|
-
- test/config_test.rb
|
131
|
-
- test/rss_publisher_test.rb
|
132
|
-
- test/perforce_scm_test.rb
|
133
|
-
- test/jabber_publisher_test.rb
|
134
|
-
- test/test_helper.rb
|
135
|
-
- test/twitter_publisher_test.rb
|
136
129
|
- test/bjam_builder_test.rb
|
137
|
-
- test/
|
138
|
-
- test/mock/marshmallow.rb
|
139
|
-
- test/mock/twitter.rb
|
140
|
-
- test/mock/manager.rb
|
141
|
-
- test/mock/xmpp4r.rb
|
142
|
-
- test/mock/irc.rb
|
130
|
+
- test/config_test.rb
|
143
131
|
- test/data
|
144
|
-
- test/data/subversion.dump
|
145
132
|
- test/data/darcs.zip
|
146
133
|
- test/data/git.zip
|
134
|
+
- test/data/subversion.dump
|
147
135
|
- test/functional_test.rb
|
148
|
-
- test/
|
149
|
-
- test/mail_publisher_test.rb
|
136
|
+
- test/integration_test.rb
|
150
137
|
- test/irc_publisher_test.rb
|
138
|
+
- test/jabber_publisher_test.rb
|
139
|
+
- test/mail_publisher_test.rb
|
140
|
+
- test/maven2_builer_test.rb
|
141
|
+
- test/mock
|
142
|
+
- test/mock/irc.rb
|
143
|
+
- test/mock/manager.rb
|
144
|
+
- test/mock/marshmallow.rb
|
145
|
+
- test/mock/twitter.rb
|
146
|
+
- test/mock/xmpp4r.rb
|
147
|
+
- test/perforce_scm_test.rb
|
148
|
+
- test/rspec_builder_test.rb
|
149
|
+
- test/rss_publisher_test.rb
|
150
|
+
- test/test_helper.rb
|
151
|
+
- test/twitter_publisher_test.rb
|
151
152
|
- LICENSE
|
152
153
|
- README
|
153
154
|
- CHANGES
|
@@ -180,14 +181,15 @@ signing_key:
|
|
180
181
|
specification_version: 2
|
181
182
|
summary: Cerberus is a Continuous Integration tool that could be easily run from Cron.
|
182
183
|
test_files:
|
183
|
-
- test/integration_test.rb
|
184
|
-
- test/config_test.rb
|
185
|
-
- test/rss_publisher_test.rb
|
186
|
-
- test/perforce_scm_test.rb
|
187
|
-
- test/jabber_publisher_test.rb
|
188
|
-
- test/twitter_publisher_test.rb
|
189
184
|
- test/bjam_builder_test.rb
|
185
|
+
- test/config_test.rb
|
190
186
|
- test/functional_test.rb
|
191
|
-
- test/
|
192
|
-
- test/mail_publisher_test.rb
|
187
|
+
- test/integration_test.rb
|
193
188
|
- test/irc_publisher_test.rb
|
189
|
+
- test/jabber_publisher_test.rb
|
190
|
+
- test/mail_publisher_test.rb
|
191
|
+
- test/maven2_builer_test.rb
|
192
|
+
- test/perforce_scm_test.rb
|
193
|
+
- test/rspec_builder_test.rb
|
194
|
+
- test/rss_publisher_test.rb
|
195
|
+
- test/twitter_publisher_test.rb
|