deep_test_pre 2.0
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/CHANGELOG +47 -0
- data/README.rdoc +199 -0
- data/Rakefile +137 -0
- data/lib/deep_test.rb +78 -0
- data/lib/deep_test/agent.rb +108 -0
- data/lib/deep_test/central_command.rb +165 -0
- data/lib/deep_test/cpu_info.rb +22 -0
- data/lib/deep_test/database/mysql_setup_listener.rb +112 -0
- data/lib/deep_test/database/setup_listener.rb +116 -0
- data/lib/deep_test/deadlock_detector.rb +7 -0
- data/lib/deep_test/demon.rb +25 -0
- data/lib/deep_test/distributed/beachhead.rb +104 -0
- data/lib/deep_test/distributed/dispatch_controller.rb +60 -0
- data/lib/deep_test/distributed/establish_beachhead.rb +19 -0
- data/lib/deep_test/distributed/filename_resolver.rb +40 -0
- data/lib/deep_test/distributed/landing_fleet.rb +30 -0
- data/lib/deep_test/distributed/landing_ship.rb +60 -0
- data/lib/deep_test/distributed/remote_deployment.rb +56 -0
- data/lib/deep_test/distributed/rsync.rb +50 -0
- data/lib/deep_test/distributed/shell_environment.rb +50 -0
- data/lib/deep_test/distributed/ssh_client_connection_info.rb +14 -0
- data/lib/deep_test/extensions/object_extension.rb +40 -0
- data/lib/deep_test/failure_message.rb +19 -0
- data/lib/deep_test/lib_root.rb +4 -0
- data/lib/deep_test/listener_list.rb +17 -0
- data/lib/deep_test/local_deployment.rb +46 -0
- data/lib/deep_test/logger.rb +32 -0
- data/lib/deep_test/main.rb +41 -0
- data/lib/deep_test/marshallable_exception_wrapper.rb +44 -0
- data/lib/deep_test/metrics/data.rb +34 -0
- data/lib/deep_test/metrics/measurement.rb +39 -0
- data/lib/deep_test/null_listener.rb +62 -0
- data/lib/deep_test/options.rb +113 -0
- data/lib/deep_test/proxy_io.rb +77 -0
- data/lib/deep_test/rake_tasks.rb +13 -0
- data/lib/deep_test/result_reader.rb +40 -0
- data/lib/deep_test/rspec_detector.rb +21 -0
- data/lib/deep_test/spec.rb +17 -0
- data/lib/deep_test/spec/extensions/example_group_methods.rb +64 -0
- data/lib/deep_test/spec/extensions/example_methods.rb +52 -0
- data/lib/deep_test/spec/extensions/options.rb +43 -0
- data/lib/deep_test/spec/extensions/spec_task.rb +21 -0
- data/lib/deep_test/spec/runner.rb +72 -0
- data/lib/deep_test/spec/work_result.rb +35 -0
- data/lib/deep_test/spec/work_unit.rb +59 -0
- data/lib/deep_test/test.rb +10 -0
- data/lib/deep_test/test/extensions/error.rb +14 -0
- data/lib/deep_test/test/run_test_suite.rb +5 -0
- data/lib/deep_test/test/runner.rb +24 -0
- data/lib/deep_test/test/supervised_test_suite.rb +48 -0
- data/lib/deep_test/test/work_result.rb +35 -0
- data/lib/deep_test/test/work_unit.rb +40 -0
- data/lib/deep_test/test_task.rb +47 -0
- data/lib/deep_test/ui/console.rb +74 -0
- data/lib/deep_test/ui/null.rb +17 -0
- data/lib/deep_test/warlock.rb +146 -0
- data/lib/telegraph.rb +29 -0
- data/lib/telegraph/ack_sequence.rb +14 -0
- data/lib/telegraph/logging.rb +20 -0
- data/lib/telegraph/message.rb +39 -0
- data/lib/telegraph/operator.rb +47 -0
- data/lib/telegraph/switchboard.rb +57 -0
- data/lib/telegraph/wire.rb +73 -0
- data/test/deep_test/agent_test.rb +175 -0
- data/test/deep_test/central_command_test.rb +147 -0
- data/test/deep_test/cpu_info_test.rb +33 -0
- data/test/deep_test/database/mysql_setup_listener_test.rb +18 -0
- data/test/deep_test/demon_test.rb +23 -0
- data/test/deep_test/distributed/beachhead_test.rb +67 -0
- data/test/deep_test/distributed/dispatch_controller_test.rb +162 -0
- data/test/deep_test/distributed/filename_resolver_test.rb +56 -0
- data/test/deep_test/distributed/landing_fleet_test.rb +55 -0
- data/test/deep_test/distributed/landing_ship_test.rb +48 -0
- data/test/deep_test/distributed/remote_deployment_test.rb +134 -0
- data/test/deep_test/distributed/rsync_test.rb +47 -0
- data/test/deep_test/distributed/shell_environment_test.rb +108 -0
- data/test/deep_test/distributed/ssh_client_connection_info_test.rb +34 -0
- data/test/deep_test/extensions/object_extension_test.rb +37 -0
- data/test/deep_test/listener_list_test.rb +22 -0
- data/test/deep_test/local_deployment_test.rb +19 -0
- data/test/deep_test/logger_test.rb +38 -0
- data/test/deep_test/main_test.rb +12 -0
- data/test/deep_test/marshallable_exception_wrapper_test.rb +46 -0
- data/test/deep_test/metrics/data_test.rb +22 -0
- data/test/deep_test/metrics/measurement_test.rb +18 -0
- data/test/deep_test/proxy_io_test.rb +104 -0
- data/test/deep_test/result_reader_test.rb +128 -0
- data/test/deep_test/test/extensions/error_test.rb +42 -0
- data/test/deep_test/test/runner_test.rb +11 -0
- data/test/deep_test/test/supervised_test_suite_test.rb +107 -0
- data/test/deep_test/test/work_result_test.rb +85 -0
- data/test/deep_test/test/work_unit_test.rb +63 -0
- data/test/deep_test/test_task_test.rb +15 -0
- data/test/deep_test/ui/console_test.rb +13 -0
- data/test/deep_test/warlock_test.rb +40 -0
- data/test/test_helper.rb +30 -0
- data/test/test_task_test.rb +75 -0
- metadata +156 -0
data/CHANGELOG
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
1.2.2 (October 11, 2008)
|
|
2
|
+
|
|
3
|
+
* Added libs option to DeepTest::TestTask for Rails 2.1 compatibility
|
|
4
|
+
* RSpec 1.1.8 compatibility
|
|
5
|
+
* Require RSpec 1.1.8
|
|
6
|
+
|
|
7
|
+
1.2.1 (September 25, 2008)
|
|
8
|
+
|
|
9
|
+
* rspec 1.1.4 compatibility
|
|
10
|
+
* Requires rspec 1.1.4
|
|
11
|
+
|
|
12
|
+
1.2.0 (March 28, 2008)
|
|
13
|
+
|
|
14
|
+
* Added capability to run distributed
|
|
15
|
+
* Changed to use straight DRb instead of Rinda (performance)
|
|
16
|
+
* Changed error raised on before/after(:all) to warning
|
|
17
|
+
* Added worker listener to setup mysql database for each worker
|
|
18
|
+
* Run test server in same process
|
|
19
|
+
* Check rspec version when loading rspec support
|
|
20
|
+
* Add support for multiple worker listeners
|
|
21
|
+
|
|
22
|
+
1.1.4 (March 11, 2008)
|
|
23
|
+
|
|
24
|
+
* Fixed 2 RSpec pending example bugs
|
|
25
|
+
* Fixed setting spec_opts with DeepTest bug
|
|
26
|
+
* Raise an error if before or after all is defined
|
|
27
|
+
* Added server_port to configuration options
|
|
28
|
+
* Wait for signal from server indicating it is ready on startup
|
|
29
|
+
|
|
30
|
+
1.1.3 (March 10, 2008)
|
|
31
|
+
|
|
32
|
+
* Added Support for RSpec
|
|
33
|
+
* Added DeepTest::TestTask#timeout_in_seconds to configure Rinda IO timeouts
|
|
34
|
+
* Added worker_listener to configuration options
|
|
35
|
+
|
|
36
|
+
1.1.2 (February 9, 2008)
|
|
37
|
+
|
|
38
|
+
* Fix bug with run_test_suite script not exiting with correct exit code.
|
|
39
|
+
|
|
40
|
+
1.1.1 (February 9, 2008)
|
|
41
|
+
|
|
42
|
+
* No longer fork from Rake process.
|
|
43
|
+
|
|
44
|
+
1.1.0 (December 23, 2007)
|
|
45
|
+
|
|
46
|
+
* DeepTest::TestTask#processes= is now DeepTest::TestTask#number_of_workers=
|
|
47
|
+
* No longer depend on the Daemons gem, use DeepTest::Warlock instead.
|
data/README.rdoc
ADDED
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
= DeepTest
|
|
2
|
+
|
|
3
|
+
DeepTest enables tests to run in parallel using multiple processes. Processes
|
|
4
|
+
may spawned locally to take advantage of multiple processors on a single
|
|
5
|
+
machine or distributed across many machines to take advantage of distributed
|
|
6
|
+
processing.
|
|
7
|
+
|
|
8
|
+
== Note
|
|
9
|
+
|
|
10
|
+
This README has been updated to reflect changes made on the master branch that have
|
|
11
|
+
not yet been released. If you are looking for the README for DeepTest 1.2 it is
|
|
12
|
+
availeble on the 1.2.x branch on github.
|
|
13
|
+
|
|
14
|
+
== Usage
|
|
15
|
+
|
|
16
|
+
In your Rakefile:
|
|
17
|
+
|
|
18
|
+
require "rubygems"
|
|
19
|
+
require "deep_test/rake_tasks"
|
|
20
|
+
|
|
21
|
+
# sample DeepTest task
|
|
22
|
+
|
|
23
|
+
DeepTest::TestTask.new "task_name" do |t|
|
|
24
|
+
t.number_of_agents = 2 # optional, defaults to number of cores
|
|
25
|
+
t.pattern = "test/**/*_test.rb"
|
|
26
|
+
t.libs << "test" # may be necessary for Rails >= 2.1.x
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# sample SpecTask using DeepTest
|
|
30
|
+
|
|
31
|
+
Spec::Rake::SpecTask.new(:deep_spec) do |t|
|
|
32
|
+
t.spec_files = FileList['spec/**/*_spec.rb']
|
|
33
|
+
t.deep_test :number_of_agents => 2 # optional, defaults to number of cores
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
=== Specifying a Listener to be Notified of Events
|
|
38
|
+
|
|
39
|
+
In my_listener.rb
|
|
40
|
+
class MyListener
|
|
41
|
+
def before_sync
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def before_starting_agents
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def starting(agent)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def starting_work(agent, work_unit)
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def finished_work(agent, work_unit, result)
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
In your Rakefile
|
|
58
|
+
|
|
59
|
+
DeepTest::TestTask.new "task_name" do |t|
|
|
60
|
+
...
|
|
61
|
+
t.listener = "MyListener"
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
An instance of MyListener will be created for each agent that is
|
|
65
|
+
started, and will receive events from that agent. However, you must ensure
|
|
66
|
+
that the MyListener class is loaded at the time that the test files are
|
|
67
|
+
loaded, so it is available to be instantiated. You can specify multiple
|
|
68
|
+
listener classes by separating them with a comma. For more information about
|
|
69
|
+
when events are triggered, see the documentation at
|
|
70
|
+
DeepTest::NullListener.
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
=== Setting Up A New Database For Each Agent
|
|
74
|
+
|
|
75
|
+
By default, DeepTest will reinitialize ActiveRecord connections if ActiveRecord
|
|
76
|
+
is loaded when the agents are started. This means all agents are running
|
|
77
|
+
against the same database. You may want each agent to use a database
|
|
78
|
+
decidicated to it. To facilitate this, DeepTest provides a agent listener to
|
|
79
|
+
help you. If you're using Rails with Mysql, simply configure DeepTest as
|
|
80
|
+
follows in your Rakefile:
|
|
81
|
+
|
|
82
|
+
DeepTest::TestTask.new "task_name" do |t|
|
|
83
|
+
...
|
|
84
|
+
t.listener = "DeepTest::Database::MysqlSetupListener"
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
Before spawning agents, DeepTest will dump the schema of the database for the
|
|
89
|
+
current Rails environment (usually test). As each agent starts up, the
|
|
90
|
+
listener will create a database dedicated to that agent and load the schema
|
|
91
|
+
into it. The database will be dropped when the agent process exits.
|
|
92
|
+
|
|
93
|
+
If you're using Mysql but not using Rails, you'll have to create a subclass of
|
|
94
|
+
MysqlSetupListener and override +master_database_config+ and +dump_file_name+,
|
|
95
|
+
as the default implementations of these methods are Rails specific.
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
If you're using a database other than Mysql, read the documentation for
|
|
99
|
+
DeepTest::Database::SetupListener and create a new subclass for your database
|
|
100
|
+
type. If you do this, please consider contributing your subclass back to the
|
|
101
|
+
project so that it can be included in later releases of DeepTest.
|
|
102
|
+
|
|
103
|
+
=== Distributing Tests Across Multiple Machines
|
|
104
|
+
|
|
105
|
+
In addition to running your tests in parallel, DeepTest can also distribute
|
|
106
|
+
them across multiple machines. It does this by first mirroring the local
|
|
107
|
+
working copy that launched the tests on each machine that will be running tests.
|
|
108
|
+
Then agents are launched on each of the machines and consume tests in the same
|
|
109
|
+
fashion as when DeepTest is running locally.
|
|
110
|
+
|
|
111
|
+
==== Requirements
|
|
112
|
+
|
|
113
|
+
Before you can distribute tests, you must ensure that all the machines involved
|
|
114
|
+
(including the machine with the local working copy) have rsync installed for
|
|
115
|
+
mirroring working copies. You must also have either SSH or an RSync daemon
|
|
116
|
+
exposing your local working copy running on the local development machine. For
|
|
117
|
+
more information about rsync, visit the rsync
|
|
118
|
+
webpage[http://www.samba.org/rsync/]. Currently only passwordless access is
|
|
119
|
+
supported, so you must either setup your RSync daemon to be accessible without
|
|
120
|
+
a password or enable passwordless SSH access from the test machines to the
|
|
121
|
+
local development machine. DeepTest must also be installed as a gem on each
|
|
122
|
+
test machine and available either as a gem or in your project on the local
|
|
123
|
+
machine.
|
|
124
|
+
|
|
125
|
+
==== Configuring Your Project
|
|
126
|
+
|
|
127
|
+
There is no need to start a special daemon process on the machines that will
|
|
128
|
+
be used to run DeepTest. Simply specify the names of the hosts that you
|
|
129
|
+
would like DeepTest to distribute to along with a set of sync_options telling
|
|
130
|
+
it how to to rsync the project code.
|
|
131
|
+
|
|
132
|
+
If you're using rsync over ssh, create a DeepTest test task similar to that
|
|
133
|
+
below in your Rakefile.
|
|
134
|
+
|
|
135
|
+
DeepTest::TestTask.new "deep_test_distributed" do |t|
|
|
136
|
+
t.pattern = "test/**/*_test.rb" # whatever is appropriate for your project
|
|
137
|
+
t.distributed_hosts = %w[host1 host2]
|
|
138
|
+
t.sync_options = {
|
|
139
|
+
:source => <absolute path of project root on machine>,
|
|
140
|
+
:username => "username",
|
|
141
|
+
:remote_base_dir => <absolute path to keep working copies in on remote machine> # defaults to /tmp
|
|
142
|
+
}
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
The :source entry in sync_options can be easily calculated based on the value
|
|
146
|
+
of \_\_FILE__ when defining the task. :username will be used by rsync to ssh
|
|
147
|
+
back to the local machine and mirror the working copy.
|
|
148
|
+
|
|
149
|
+
If you have an rsync daemon running in your local machine, configure the
|
|
150
|
+
rake task as follows.
|
|
151
|
+
|
|
152
|
+
DeepTest::TestTask.new "deep_test_distributed" do |t|
|
|
153
|
+
t.pattern = "test/**/*_test.rb" # whatever is appropriate for your project
|
|
154
|
+
t.distributed_hosts = %w[host1 host2]
|
|
155
|
+
t.sync_options = {
|
|
156
|
+
:source => <name of rsync module from daemon configuration>,
|
|
157
|
+
:daemon => true,
|
|
158
|
+
:username => "username"
|
|
159
|
+
}
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
Username is optional in both cases. You'll need to either setup passwordless
|
|
163
|
+
ssh access or run an rsync daemon that doesn't require passwords.
|
|
164
|
+
|
|
165
|
+
There may be other options you'd like to pass to rsync in your particular
|
|
166
|
+
scenario. This can be done by adding an :rsync_options entry to sync_options.
|
|
167
|
+
For example, if you're working on a Rails project you'll probably want to at
|
|
168
|
+
least have something like this:
|
|
169
|
+
|
|
170
|
+
DeepTest::TestTask.new "deep_test_distributed" do |t|
|
|
171
|
+
...
|
|
172
|
+
excludes = %w[.svn tmp/** log/**]
|
|
173
|
+
t.sync_options = {
|
|
174
|
+
...
|
|
175
|
+
:rsync_options => excludes.map {|s| "'--exclude=#{s}'"}.join(' ')
|
|
176
|
+
}
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
That way you can avoid spending any time mirroring tmp and log files that don't
|
|
180
|
+
have any effect on the tests. If you are running distributed tests against a
|
|
181
|
+
database, consult the section above about creating a new database for each
|
|
182
|
+
agent to see how to configure DeepTest for your project.
|
|
183
|
+
|
|
184
|
+
Any number of projects can be run using the same test servers, as long as
|
|
185
|
+
they're all using the same version of Ruby and DeepTest.
|
|
186
|
+
|
|
187
|
+
== Contributors
|
|
188
|
+
|
|
189
|
+
* anonymous z
|
|
190
|
+
* Alex Chaffee
|
|
191
|
+
* Dan[http://www.dcmanges.com/blog] Manges[http://www.dcmanges.com/blog]
|
|
192
|
+
* David[http://davidvollbracht.com/] Vollbracht[http://davidvollbracht.com/]
|
|
193
|
+
* Brian[http://blog.brianguthrie.com/] Guthrie[http://blog.brianguthrie.com/]
|
|
194
|
+
* Shane[http://shanel.tumblr.com/] Liebling[http://shanel.tumblr.com/]
|
|
195
|
+
* Scott Taylor
|
|
196
|
+
|
|
197
|
+
== License
|
|
198
|
+
|
|
199
|
+
DeepTest Released under Ruby's[http://www.ruby-lang.org/en/LICENSE.txt] license[http://www.ruby-lang.org/en/LICENSE.txt]
|
data/Rakefile
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
require 'rake'
|
|
2
|
+
require 'rake/testtask'
|
|
3
|
+
require 'rake/rdoctask'
|
|
4
|
+
require 'rake/gempackagetask'
|
|
5
|
+
require 'rake/contrib/sshpublisher'
|
|
6
|
+
require 'yaml'
|
|
7
|
+
|
|
8
|
+
require 'rubygems'
|
|
9
|
+
gem('rspec', ENV['RSPEC_VERSION'] || '1.1.12')
|
|
10
|
+
require 'spec/rake/spectask'
|
|
11
|
+
|
|
12
|
+
$LOAD_PATH << File.dirname(__FILE__) + "/lib"
|
|
13
|
+
|
|
14
|
+
require "deep_test/rake_tasks"
|
|
15
|
+
|
|
16
|
+
task :default => %w[
|
|
17
|
+
test
|
|
18
|
+
spec
|
|
19
|
+
deep_test
|
|
20
|
+
deep_spec_1.1.12
|
|
21
|
+
|
|
22
|
+
]
|
|
23
|
+
|
|
24
|
+
#deep_spec_1.1.8
|
|
25
|
+
# distributed_test
|
|
26
|
+
# distributed_spec
|
|
27
|
+
# negative_acceptance_tests
|
|
28
|
+
# test_rails_project
|
|
29
|
+
|
|
30
|
+
task :pc => :default
|
|
31
|
+
|
|
32
|
+
Rake::TestTask.new do |t|
|
|
33
|
+
t.pattern = "test/**/*_test.rb"
|
|
34
|
+
t.libs += ['test', 'lib']
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
DeepTest::TestTask.new :deep_test do |t|
|
|
38
|
+
t.pattern = "test/**/*_test.rb"
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
DeepTest::TestTask.new(:manual_distributed_test) do |t|
|
|
42
|
+
t.pattern = "test/**/*_test.rb"
|
|
43
|
+
t.distributed_hosts = (ENV['HOSTS'] || '').split(' ')
|
|
44
|
+
t.sync_options = {:source => File.dirname(__FILE__),
|
|
45
|
+
:username => ENV['USERNAME'],
|
|
46
|
+
:rsync_options => "--exclude=.svn"}
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
DeepTest::TestTask.new(:distributed_test) do |t|
|
|
50
|
+
t.pattern = "test/**/*_test.rb"
|
|
51
|
+
t.distributed_hosts = %w[localhost]
|
|
52
|
+
t.sync_options = {:source => File.dirname(__FILE__),
|
|
53
|
+
:rsync_options => "--exclude=.svn",
|
|
54
|
+
:remote_base_dir => "/tmp/deep_test"}
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
Spec::Rake::SpecTask.new(:spec) do |t|
|
|
58
|
+
t.spec_files = FileList['spec/**/*_spec.rb']
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
Spec::Rake::SpecTask.new(:deep_spec) do |t|
|
|
62
|
+
t.spec_files = FileList['spec/**/*_spec.rb']
|
|
63
|
+
t.deep_test({})
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
task :'deep_spec_1.1.8' do
|
|
67
|
+
sh 'rake deep_spec RSPEC_VERSION=1.1.8'
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
task :'deep_spec_1.1.12' do
|
|
71
|
+
sh 'rake deep_spec RSPEC_VERSION=1.1.12'
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
Spec::Rake::SpecTask.new(:distributed_spec) do |t|
|
|
75
|
+
t.spec_files = FileList['spec/**/*_spec.rb']
|
|
76
|
+
t.deep_test :distributed_hosts => %w[localhost],
|
|
77
|
+
:sync_options => {:source => File.dirname(__FILE__),
|
|
78
|
+
:rsync_options => "--exclude=.svn"}
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
Rake::TestTask.new(:negative_acceptance_tests) do |t|
|
|
82
|
+
t.pattern = "negative_acceptance_tests/tests.rb"
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
Rake::TestTask.new(:test_rails_project) do |t|
|
|
86
|
+
t.pattern = "sample_rails_project/deep_test.rb"
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
desc "Generate documentation"
|
|
90
|
+
Rake::RDocTask.new(:rdoc) do |rdoc|
|
|
91
|
+
rdoc.rdoc_dir = "doc"
|
|
92
|
+
rdoc.title = "DeepTest"
|
|
93
|
+
rdoc.options << '--line-numbers'
|
|
94
|
+
rdoc.rdoc_files.include(
|
|
95
|
+
'README.rdoc',
|
|
96
|
+
'CHANGELOG',
|
|
97
|
+
'lib/deep_test/null_listener.rb',
|
|
98
|
+
'lib/deep_test/database/*.rb'
|
|
99
|
+
)
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
desc "Upload RDoc to RubyForge"
|
|
103
|
+
task :publish_rdoc => [:rerdoc] do
|
|
104
|
+
rubyforge_config = "#{ENV['HOME']}/.rubyforge/user-config.yml"
|
|
105
|
+
username = YAML.load_file(rubyforge_config)["username"]
|
|
106
|
+
sh "chmod -R 775 doc"
|
|
107
|
+
sh "scp -rqp doc/* #{username}@rubyforge.org:/var/www/gforge-projects/deep-test"
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
specification = Gem::Specification.new do |s|
|
|
111
|
+
s.platform = Gem::Platform::RUBY
|
|
112
|
+
s.name = "deep_test_pre"
|
|
113
|
+
s.summary = "DeepTest runs tests in multiple processes."
|
|
114
|
+
s.version = "2.0"
|
|
115
|
+
s.author = "anonymous z, Dan Manges, David Vollbracht"
|
|
116
|
+
s.description = s.summary
|
|
117
|
+
s.email = "daniel.manges@gmail.com"
|
|
118
|
+
s.homepage = "http://deep-test.rubyforge.org"
|
|
119
|
+
s.rubyforge_project = "deep-test"
|
|
120
|
+
|
|
121
|
+
s.has_rdoc = true
|
|
122
|
+
s.extra_rdoc_files = ['README.rdoc', 'CHANGELOG']
|
|
123
|
+
s.rdoc_options << '--title' << "DeepTest" << '--main' << 'README.rdoc' << '--line-numbers'
|
|
124
|
+
|
|
125
|
+
s.files = FileList['{lib,test}/**/*.{rb,rake}', 'README.rdoc', 'CHANGELOG', 'Rakefile'].to_a
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
Rake::GemPackageTask.new(specification) do |package|
|
|
129
|
+
package.need_zip = true
|
|
130
|
+
package.need_tar = true
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
Rake::Task[:gem].prerequisites.unshift :default
|
|
134
|
+
|
|
135
|
+
task :tar do
|
|
136
|
+
system "tar zcf pkg/deep_test.tar.gz --exclude=.svn --exclude='*.tar.gz' --exclude='*.gem' --directory=.. deep_test"
|
|
137
|
+
end
|
data/lib/deep_test.rb
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
module DeepTest
|
|
2
|
+
class << self
|
|
3
|
+
def logger
|
|
4
|
+
@logger ||= DeepTest::Logger.new($stdout)
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
def logger=(logger)
|
|
8
|
+
@logger = logger
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
class IncompleteTestRunError < StandardError
|
|
13
|
+
def initialize(count)
|
|
14
|
+
super "#{count} tests were not run because the DeepTest Agents died"
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def backtrace
|
|
18
|
+
[]
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
require "logger"
|
|
24
|
+
require "timeout"
|
|
25
|
+
require "thread"
|
|
26
|
+
require "socket"
|
|
27
|
+
require "webrick"
|
|
28
|
+
require "timeout"
|
|
29
|
+
require "base64"
|
|
30
|
+
|
|
31
|
+
require File.dirname(__FILE__) + "/telegraph"
|
|
32
|
+
require File.dirname(__FILE__) + "/deep_test/lib_root"
|
|
33
|
+
require File.dirname(__FILE__) + "/deep_test/extensions/object_extension"
|
|
34
|
+
|
|
35
|
+
require File.dirname(__FILE__) + "/deep_test/demon"
|
|
36
|
+
require File.dirname(__FILE__) + "/deep_test/deadlock_detector"
|
|
37
|
+
require File.dirname(__FILE__) + "/deep_test/local_deployment"
|
|
38
|
+
require File.dirname(__FILE__) + "/deep_test/logger"
|
|
39
|
+
|
|
40
|
+
require File.dirname(__FILE__) + "/deep_test/marshallable_exception_wrapper"
|
|
41
|
+
require File.dirname(__FILE__) + "/deep_test/null_listener"
|
|
42
|
+
require File.dirname(__FILE__) + "/deep_test/listener_list"
|
|
43
|
+
require File.dirname(__FILE__) + "/deep_test/cpu_info"
|
|
44
|
+
require File.dirname(__FILE__) + "/deep_test/failure_message"
|
|
45
|
+
require File.dirname(__FILE__) + "/deep_test/options"
|
|
46
|
+
require File.dirname(__FILE__) + "/deep_test/main"
|
|
47
|
+
require File.dirname(__FILE__) + "/deep_test/result_reader"
|
|
48
|
+
require File.dirname(__FILE__) + "/deep_test/rspec_detector"
|
|
49
|
+
require File.dirname(__FILE__) + "/deep_test/central_command"
|
|
50
|
+
require File.dirname(__FILE__) + "/deep_test/proxy_io"
|
|
51
|
+
require File.dirname(__FILE__) + "/deep_test/test_task"
|
|
52
|
+
require File.dirname(__FILE__) + "/deep_test/agent"
|
|
53
|
+
require File.dirname(__FILE__) + "/deep_test/warlock"
|
|
54
|
+
|
|
55
|
+
require File.dirname(__FILE__) + "/deep_test/database/setup_listener"
|
|
56
|
+
require File.dirname(__FILE__) + "/deep_test/database/mysql_setup_listener"
|
|
57
|
+
|
|
58
|
+
require File.dirname(__FILE__) + "/deep_test/distributed/shell_environment"
|
|
59
|
+
require File.dirname(__FILE__) + "/deep_test/distributed/landing_ship"
|
|
60
|
+
require File.dirname(__FILE__) + "/deep_test/distributed/dispatch_controller"
|
|
61
|
+
require File.dirname(__FILE__) + "/deep_test/distributed/ssh_client_connection_info"
|
|
62
|
+
require File.dirname(__FILE__) + "/deep_test/distributed/filename_resolver"
|
|
63
|
+
require File.dirname(__FILE__) + "/deep_test/distributed/landing_fleet"
|
|
64
|
+
require File.dirname(__FILE__) + "/deep_test/distributed/remote_deployment"
|
|
65
|
+
require File.dirname(__FILE__) + "/deep_test/distributed/beachhead"
|
|
66
|
+
require File.dirname(__FILE__) + "/deep_test/distributed/rsync"
|
|
67
|
+
|
|
68
|
+
require File.dirname(__FILE__) + "/deep_test/metrics/data"
|
|
69
|
+
require File.dirname(__FILE__) + "/deep_test/metrics/measurement"
|
|
70
|
+
|
|
71
|
+
DeepTest::RSpecDetector.if_rspec_available do
|
|
72
|
+
require File.dirname(__FILE__) + "/deep_test/spec"
|
|
73
|
+
end
|
|
74
|
+
require File.dirname(__FILE__) + "/deep_test/test"
|
|
75
|
+
|
|
76
|
+
require File.dirname(__FILE__) + "/deep_test/ui/console"
|
|
77
|
+
require File.dirname(__FILE__) + "/deep_test/ui/null"
|
|
78
|
+
|