dtr 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +21 -0
- data/README.rdoc +39 -28
- data/Rakefile +1 -1
- data/TODO +1 -3
- data/bin/dtr +20 -13
- data/dtr.gemspec +3 -3
- data/lib/dtr.rb +2 -2
- data/lib/dtr/agent.rb +12 -5
- data/lib/dtr/agent/brain.rb +45 -19
- data/lib/dtr/agent/herald.rb +8 -10
- data/lib/dtr/agent/process_root.rb +23 -0
- data/lib/dtr/agent/rails_ext.rb +57 -0
- data/lib/dtr/agent/runner.rb +19 -39
- data/lib/dtr/agent/sync_codebase.rb +10 -19
- data/lib/dtr/agent/sync_logger.rb +1 -0
- data/lib/dtr/agent/worker.rb +13 -61
- data/lib/dtr/agent/working_env_ext.rb +51 -17
- data/lib/dtr/agent/working_status.rb +34 -0
- data/lib/dtr/facade.rb +19 -17
- data/lib/dtr/master.rb +2 -0
- data/lib/dtr/monitor.rb +2 -2
- data/lib/dtr/raketasks.rb +14 -19
- data/lib/dtr/shared.rb +1 -0
- data/lib/dtr/shared/adapter.rb +2 -101
- data/lib/dtr/shared/adapter/base.rb +118 -0
- data/lib/dtr/shared/adapter/mortality.rb +41 -0
- data/lib/dtr/shared/configuration.rb +32 -14
- data/lib/dtr/shared/root.rb +20 -0
- data/lib/dtr/shared/sync_codebase/master_ext.rb +2 -2
- data/lib/dtr/shared/sync_codebase/sync_service.rb +7 -4
- data/lib/dtr/shared/utils/cmd.rb +4 -2
- data/lib/dtr/shared/utils/env_store.rb +16 -24
- data/lib/dtr/shared/working_env.rb +8 -0
- data/lib/dtr/test_unit/drb_test_runner.rb +1 -1
- data/lib/dtr/test_unit/thread_safe_test_result.rb +56 -3
- data/test/acceptance/dtr_package_task_test.rb +3 -3
- data/test/acceptance/general_test.rb +3 -3
- data/test/acceptance/rails_ext_test.rb +86 -0
- data/test/acceptance/raketasks_test.rb +14 -0
- data/test/acceptance/sync_codebase_test.rb +8 -31
- data/test/acceptance/sync_logger_test.rb +6 -3
- data/test/agent_helper.rb +24 -16
- data/test/logger_stub.rb +3 -3
- data/test/test_helper.rb +12 -9
- data/test/unit/adapter_test.rb +1 -1
- data/test/unit/configuration_test.rb +36 -4
- data/test/unit/database_initializer_test.rb +36 -0
- data/test/unit/facade_test.rb +11 -1
- data/test/unit/thread_safe_test_result_test.rb +41 -0
- data/test/unit/working_env_test.rb +11 -21
- data/testdata/rails_projects/simple_project/README +256 -0
- data/testdata/rails_projects/simple_project/Rakefile +10 -0
- data/testdata/rails_projects/simple_project/app/controllers/application.rb +15 -0
- data/testdata/rails_projects/simple_project/app/controllers/products_controller.rb +5 -0
- data/testdata/rails_projects/simple_project/app/helpers/application_helper.rb +3 -0
- data/testdata/rails_projects/simple_project/app/helpers/products_helper.rb +2 -0
- data/testdata/rails_projects/simple_project/app/models/product.rb +5 -0
- data/testdata/rails_projects/simple_project/app/views/products/index.rhtml +7 -0
- data/testdata/rails_projects/simple_project/config/boot.rb +109 -0
- data/testdata/rails_projects/simple_project/config/database.yml +19 -0
- data/testdata/rails_projects/simple_project/config/database.yml.mysql +12 -0
- data/testdata/rails_projects/simple_project/config/environment.rb +67 -0
- data/testdata/rails_projects/simple_project/config/environments/development.rb +17 -0
- data/testdata/rails_projects/simple_project/config/environments/production.rb +22 -0
- data/testdata/rails_projects/simple_project/config/environments/test.rb +22 -0
- data/testdata/rails_projects/simple_project/config/initializers/inflections.rb +10 -0
- data/testdata/rails_projects/simple_project/config/initializers/mime_types.rb +5 -0
- data/testdata/rails_projects/simple_project/config/initializers/new_rails_defaults.rb +17 -0
- data/testdata/rails_projects/simple_project/config/routes.rb +43 -0
- data/testdata/rails_projects/simple_project/db/migrate/20081027133744_create_products.rb +13 -0
- data/testdata/rails_projects/simple_project/db/schema.rb +21 -0
- data/testdata/rails_projects/simple_project/doc/README_FOR_APP +2 -0
- data/testdata/rails_projects/simple_project/public/404.html +30 -0
- data/testdata/rails_projects/simple_project/public/422.html +30 -0
- data/testdata/rails_projects/simple_project/public/500.html +30 -0
- data/testdata/rails_projects/simple_project/public/dispatch.cgi +10 -0
- data/testdata/rails_projects/simple_project/public/dispatch.fcgi +24 -0
- data/testdata/rails_projects/simple_project/public/dispatch.rb +10 -0
- data/testdata/rails_projects/simple_project/public/favicon.ico +0 -0
- data/testdata/rails_projects/simple_project/public/images/rails.png +0 -0
- data/testdata/rails_projects/simple_project/public/index.html +274 -0
- data/testdata/rails_projects/simple_project/public/javascripts/application.js +2 -0
- data/testdata/rails_projects/simple_project/public/javascripts/controls.js +963 -0
- data/testdata/rails_projects/simple_project/public/javascripts/dragdrop.js +972 -0
- data/testdata/rails_projects/simple_project/public/javascripts/effects.js +1120 -0
- data/testdata/rails_projects/simple_project/public/javascripts/prototype.js +4225 -0
- data/testdata/rails_projects/simple_project/public/robots.txt +5 -0
- data/testdata/rails_projects/simple_project/script/about +4 -0
- data/testdata/rails_projects/simple_project/script/console +3 -0
- data/testdata/rails_projects/simple_project/script/dbconsole +3 -0
- data/testdata/rails_projects/simple_project/script/destroy +3 -0
- data/testdata/rails_projects/simple_project/script/generate +3 -0
- data/testdata/rails_projects/simple_project/script/performance/benchmarker +3 -0
- data/testdata/rails_projects/simple_project/script/performance/profiler +3 -0
- data/testdata/rails_projects/simple_project/script/performance/request +3 -0
- data/testdata/rails_projects/simple_project/script/plugin +3 -0
- data/testdata/rails_projects/simple_project/script/process/inspector +3 -0
- data/testdata/rails_projects/simple_project/script/process/reaper +3 -0
- data/testdata/rails_projects/simple_project/script/process/spawner +3 -0
- data/testdata/rails_projects/simple_project/script/runner +3 -0
- data/testdata/rails_projects/simple_project/script/server +3 -0
- data/testdata/rails_projects/simple_project/test/fixtures/products.yml +9 -0
- data/testdata/rails_projects/simple_project/test/functional/products_controller_test.rb +11 -0
- data/testdata/rails_projects/simple_project/test/test_helper.rb +38 -0
- data/testdata/rails_projects/simple_project/test/unit/product_test.rb +27 -0
- data/testdata/raketasks/Rakefile +1 -1
- metadata +90 -5
- data/testdata/verify_dir_pwd/Rakefile +0 -6
- data/testdata/verify_dir_pwd/verify_dir_pwd_test_case.rb +0 -10
@@ -0,0 +1,38 @@
|
|
1
|
+
ENV["RAILS_ENV"] = "test"
|
2
|
+
require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
|
3
|
+
require 'test_help'
|
4
|
+
|
5
|
+
class Test::Unit::TestCase
|
6
|
+
# Transactional fixtures accelerate your tests by wrapping each test method
|
7
|
+
# in a transaction that's rolled back on completion. This ensures that the
|
8
|
+
# test database remains unchanged so your fixtures don't have to be reloaded
|
9
|
+
# between every test method. Fewer database queries means faster tests.
|
10
|
+
#
|
11
|
+
# Read Mike Clark's excellent walkthrough at
|
12
|
+
# http://clarkware.com/cgi/blosxom/2005/10/24#Rails10FastTesting
|
13
|
+
#
|
14
|
+
# Every Active Record database supports transactions except MyISAM tables
|
15
|
+
# in MySQL. Turn off transactional fixtures in this case; however, if you
|
16
|
+
# don't care one way or the other, switching from MyISAM to InnoDB tables
|
17
|
+
# is recommended.
|
18
|
+
#
|
19
|
+
# The only drawback to using transactional fixtures is when you actually
|
20
|
+
# need to test transactions. Since your test is bracketed by a transaction,
|
21
|
+
# any transactions started in your code will be automatically rolled back.
|
22
|
+
self.use_transactional_fixtures = true
|
23
|
+
|
24
|
+
# Instantiated fixtures are slow, but give you @david where otherwise you
|
25
|
+
# would need people(:david). If you don't want to migrate your existing
|
26
|
+
# test cases which use the @david style and don't mind the speed hit (each
|
27
|
+
# instantiated fixtures translates to a database query per test method),
|
28
|
+
# then set this back to true.
|
29
|
+
self.use_instantiated_fixtures = false
|
30
|
+
|
31
|
+
# Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
|
32
|
+
#
|
33
|
+
# Note: You'll currently still have to declare fixtures explicitly in integration tests
|
34
|
+
# -- they do not yet inherit this setting
|
35
|
+
fixtures :all
|
36
|
+
|
37
|
+
# Add more helper methods to be used by all tests here...
|
38
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class ProductTest < ActiveSupport::TestCase
|
4
|
+
fixtures :products
|
5
|
+
|
6
|
+
def test_create
|
7
|
+
Product.create!(:name => 'Ruby', :price => 10)
|
8
|
+
assert_not_nil Product.find_by_name('Ruby')
|
9
|
+
end
|
10
|
+
|
11
|
+
def test_update
|
12
|
+
ruby = Product.create!(:name => 'Ruby', :price => 10)
|
13
|
+
ruby.update_attribute :price, 15
|
14
|
+
assert_equal 15, Product.find_by_name('Ruby').price
|
15
|
+
end
|
16
|
+
|
17
|
+
def test_desc
|
18
|
+
ruby = Product.create!(:name => 'Ruby', :price => 10)
|
19
|
+
assert_equal 'Ruby: 10', ruby.desc
|
20
|
+
end
|
21
|
+
|
22
|
+
def test_destroy
|
23
|
+
ruby = Product.create!(:name => 'Ruby', :price => 10)
|
24
|
+
ruby.destroy
|
25
|
+
assert_nil Product.find_by_name('Ruby')
|
26
|
+
end
|
27
|
+
end
|
data/testdata/raketasks/Rakefile
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dtr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Li Xiao
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-
|
12
|
+
date: 2008-12-17 00:00:00 +08:00
|
13
13
|
default_executable: dtr
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -27,6 +27,8 @@ extra_rdoc_files:
|
|
27
27
|
files:
|
28
28
|
- lib/dtr/agent/brain.rb
|
29
29
|
- lib/dtr/agent/herald.rb
|
30
|
+
- lib/dtr/agent/process_root.rb
|
31
|
+
- lib/dtr/agent/rails_ext.rb
|
30
32
|
- lib/dtr/agent/runner.rb
|
31
33
|
- lib/dtr/agent/sync_codebase.rb
|
32
34
|
- lib/dtr/agent/sync_logger.rb
|
@@ -34,14 +36,18 @@ files:
|
|
34
36
|
- lib/dtr/agent/test_unit.rb
|
35
37
|
- lib/dtr/agent/worker.rb
|
36
38
|
- lib/dtr/agent/working_env_ext.rb
|
39
|
+
- lib/dtr/agent/working_status.rb
|
37
40
|
- lib/dtr/agent.rb
|
38
41
|
- lib/dtr/facade.rb
|
39
42
|
- lib/dtr/master.rb
|
40
43
|
- lib/dtr/monitor.rb
|
41
44
|
- lib/dtr/raketasks.rb
|
45
|
+
- lib/dtr/shared/adapter/base.rb
|
46
|
+
- lib/dtr/shared/adapter/mortality.rb
|
42
47
|
- lib/dtr/shared/adapter.rb
|
43
48
|
- lib/dtr/shared/configuration.rb
|
44
49
|
- lib/dtr/shared/message_decorator.rb
|
50
|
+
- lib/dtr/shared/root.rb
|
45
51
|
- lib/dtr/shared/ruby_ext.rb
|
46
52
|
- lib/dtr/shared/service/agent.rb
|
47
53
|
- lib/dtr/shared/service/file.rb
|
@@ -115,6 +121,7 @@ test_files:
|
|
115
121
|
- test/acceptance/agent_working_env_test.rb
|
116
122
|
- test/acceptance/dtr_package_task_test.rb
|
117
123
|
- test/acceptance/general_test.rb
|
124
|
+
- test/acceptance/rails_ext_test.rb
|
118
125
|
- test/acceptance/raketasks_test.rb
|
119
126
|
- test/acceptance/sync_codebase_test.rb
|
120
127
|
- test/acceptance/sync_logger_test.rb
|
@@ -123,9 +130,11 @@ test_files:
|
|
123
130
|
- test/test_helper.rb
|
124
131
|
- test/unit/adapter_test.rb
|
125
132
|
- test/unit/configuration_test.rb
|
133
|
+
- test/unit/database_initializer_test.rb
|
126
134
|
- test/unit/facade_test.rb
|
127
135
|
- test/unit/logger_test.rb
|
128
136
|
- test/unit/test_unit_test.rb
|
137
|
+
- test/unit/thread_safe_test_result_test.rb
|
129
138
|
- test/unit/working_env_test.rb
|
130
139
|
- testdata/a_failed_test_case.rb
|
131
140
|
- testdata/a_file_system_test_case.rb
|
@@ -140,6 +149,85 @@ test_files:
|
|
140
149
|
- testdata/lib
|
141
150
|
- testdata/lib/lib_test_case.rb
|
142
151
|
- testdata/package_task_test_rakefile
|
152
|
+
- testdata/rails_projects
|
153
|
+
- testdata/rails_projects/simple_project
|
154
|
+
- testdata/rails_projects/simple_project/app
|
155
|
+
- testdata/rails_projects/simple_project/app/controllers
|
156
|
+
- testdata/rails_projects/simple_project/app/controllers/application.rb
|
157
|
+
- testdata/rails_projects/simple_project/app/controllers/products_controller.rb
|
158
|
+
- testdata/rails_projects/simple_project/app/helpers
|
159
|
+
- testdata/rails_projects/simple_project/app/helpers/application_helper.rb
|
160
|
+
- testdata/rails_projects/simple_project/app/helpers/products_helper.rb
|
161
|
+
- testdata/rails_projects/simple_project/app/models
|
162
|
+
- testdata/rails_projects/simple_project/app/models/product.rb
|
163
|
+
- testdata/rails_projects/simple_project/app/views
|
164
|
+
- testdata/rails_projects/simple_project/app/views/products
|
165
|
+
- testdata/rails_projects/simple_project/app/views/products/index.rhtml
|
166
|
+
- testdata/rails_projects/simple_project/config
|
167
|
+
- testdata/rails_projects/simple_project/config/boot.rb
|
168
|
+
- testdata/rails_projects/simple_project/config/database.yml
|
169
|
+
- testdata/rails_projects/simple_project/config/database.yml.mysql
|
170
|
+
- testdata/rails_projects/simple_project/config/environment.rb
|
171
|
+
- testdata/rails_projects/simple_project/config/environments
|
172
|
+
- testdata/rails_projects/simple_project/config/environments/development.rb
|
173
|
+
- testdata/rails_projects/simple_project/config/environments/production.rb
|
174
|
+
- testdata/rails_projects/simple_project/config/environments/test.rb
|
175
|
+
- testdata/rails_projects/simple_project/config/initializers
|
176
|
+
- testdata/rails_projects/simple_project/config/initializers/inflections.rb
|
177
|
+
- testdata/rails_projects/simple_project/config/initializers/mime_types.rb
|
178
|
+
- testdata/rails_projects/simple_project/config/initializers/new_rails_defaults.rb
|
179
|
+
- testdata/rails_projects/simple_project/config/routes.rb
|
180
|
+
- testdata/rails_projects/simple_project/db
|
181
|
+
- testdata/rails_projects/simple_project/db/migrate
|
182
|
+
- testdata/rails_projects/simple_project/db/migrate/20081027133744_create_products.rb
|
183
|
+
- testdata/rails_projects/simple_project/db/schema.rb
|
184
|
+
- testdata/rails_projects/simple_project/doc
|
185
|
+
- testdata/rails_projects/simple_project/doc/README_FOR_APP
|
186
|
+
- testdata/rails_projects/simple_project/public
|
187
|
+
- testdata/rails_projects/simple_project/public/404.html
|
188
|
+
- testdata/rails_projects/simple_project/public/422.html
|
189
|
+
- testdata/rails_projects/simple_project/public/500.html
|
190
|
+
- testdata/rails_projects/simple_project/public/dispatch.cgi
|
191
|
+
- testdata/rails_projects/simple_project/public/dispatch.fcgi
|
192
|
+
- testdata/rails_projects/simple_project/public/dispatch.rb
|
193
|
+
- testdata/rails_projects/simple_project/public/favicon.ico
|
194
|
+
- testdata/rails_projects/simple_project/public/images
|
195
|
+
- testdata/rails_projects/simple_project/public/images/rails.png
|
196
|
+
- testdata/rails_projects/simple_project/public/index.html
|
197
|
+
- testdata/rails_projects/simple_project/public/javascripts
|
198
|
+
- testdata/rails_projects/simple_project/public/javascripts/application.js
|
199
|
+
- testdata/rails_projects/simple_project/public/javascripts/controls.js
|
200
|
+
- testdata/rails_projects/simple_project/public/javascripts/dragdrop.js
|
201
|
+
- testdata/rails_projects/simple_project/public/javascripts/effects.js
|
202
|
+
- testdata/rails_projects/simple_project/public/javascripts/prototype.js
|
203
|
+
- testdata/rails_projects/simple_project/public/robots.txt
|
204
|
+
- testdata/rails_projects/simple_project/Rakefile
|
205
|
+
- testdata/rails_projects/simple_project/README
|
206
|
+
- testdata/rails_projects/simple_project/script
|
207
|
+
- testdata/rails_projects/simple_project/script/about
|
208
|
+
- testdata/rails_projects/simple_project/script/console
|
209
|
+
- testdata/rails_projects/simple_project/script/dbconsole
|
210
|
+
- testdata/rails_projects/simple_project/script/destroy
|
211
|
+
- testdata/rails_projects/simple_project/script/generate
|
212
|
+
- testdata/rails_projects/simple_project/script/performance
|
213
|
+
- testdata/rails_projects/simple_project/script/performance/benchmarker
|
214
|
+
- testdata/rails_projects/simple_project/script/performance/profiler
|
215
|
+
- testdata/rails_projects/simple_project/script/performance/request
|
216
|
+
- testdata/rails_projects/simple_project/script/plugin
|
217
|
+
- testdata/rails_projects/simple_project/script/process
|
218
|
+
- testdata/rails_projects/simple_project/script/process/inspector
|
219
|
+
- testdata/rails_projects/simple_project/script/process/reaper
|
220
|
+
- testdata/rails_projects/simple_project/script/process/spawner
|
221
|
+
- testdata/rails_projects/simple_project/script/runner
|
222
|
+
- testdata/rails_projects/simple_project/script/server
|
223
|
+
- testdata/rails_projects/simple_project/test
|
224
|
+
- testdata/rails_projects/simple_project/test/fixtures
|
225
|
+
- testdata/rails_projects/simple_project/test/fixtures/products.yml
|
226
|
+
- testdata/rails_projects/simple_project/test/functional
|
227
|
+
- testdata/rails_projects/simple_project/test/functional/products_controller_test.rb
|
228
|
+
- testdata/rails_projects/simple_project/test/test_helper.rb
|
229
|
+
- testdata/rails_projects/simple_project/test/unit
|
230
|
+
- testdata/rails_projects/simple_project/test/unit/product_test.rb
|
143
231
|
- testdata/Rakefile
|
144
232
|
- testdata/raketasks
|
145
233
|
- testdata/raketasks/Rakefile
|
@@ -147,6 +235,3 @@ test_files:
|
|
147
235
|
- testdata/scenario_test_case.rb
|
148
236
|
- testdata/setup_agent_env_test_case.rb
|
149
237
|
- testdata/sleep_3_secs_test_case.rb
|
150
|
-
- testdata/verify_dir_pwd
|
151
|
-
- testdata/verify_dir_pwd/Rakefile
|
152
|
-
- testdata/verify_dir_pwd/verify_dir_pwd_test_case.rb
|