testbot 0.5.4 → 0.5.5
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 +4 -0
- data/README.markdown +7 -7
- data/lib/shared/adapters/adapter.rb +4 -1
- data/lib/shared/adapters/helpers/ruby_env.rb +3 -3
- data/lib/shared/adapters/rspec2_adapter.rb +51 -0
- data/lib/shared/testbot.rb +1 -10
- data/lib/shared/version.rb +12 -0
- data/test/shared/adapters/helpers/test_ruby_env.rb +5 -0
- data/test/shared/adapters/test_adapter.rb +2 -1
- data/testbot.gemspec +1 -1
- metadata +7 -5
data/CHANGELOG
CHANGED
data/README.markdown
CHANGED
@@ -1,7 +1,6 @@
|
|
1
|
-
Testbot is a test distribution tool that works with Rails, RSpec, Test::Unit and Cucumber. The basic idea is that you let testbot spread the load of running your tests across multiple machines to make the tests run faster.
|
2
|
-
|
3
|
-
Using testbot on 11 machines (25 cores) we got our test suite down to **2 minutes from 30**. [More examples of how testbot is used](http://github.com/joakimk/testbot/wiki/How-testbot-is-being-used).
|
1
|
+
Testbot is a test distribution tool that works with Rails, RSpec, RSpec2, Test::Unit and Cucumber. The basic idea is that you let testbot spread the load of running your tests across multiple machines to make the tests run faster.
|
4
2
|
|
3
|
+
Using testbot on 11 machines (25 cores) we got our test suite down to **2 minutes from 30**. [More examples of how testbot is used](http://github.com/joakimk/testbot/wiki/How-testbot-is-used).
|
5
4
|
|
6
5
|
Installing
|
7
6
|
----
|
@@ -57,19 +56,19 @@ On every computer that should share CPU resources run:
|
|
57
56
|
Running tests:
|
58
57
|
|
59
58
|
testbot --test --connect 192.168.0.100
|
60
|
-
# --test could also be --spec or --features
|
59
|
+
# --test could also be --spec (RSpec), --rspec (RSpec 2) or --features
|
61
60
|
|
62
61
|
Using testbot with Rails 2:
|
63
62
|
|
64
|
-
ruby script/plugin install git://github.com/joakimk/testbot.git -r 'refs/tags/v0.5.
|
63
|
+
ruby script/plugin install git://github.com/joakimk/testbot.git -r 'refs/tags/v0.5.5'
|
65
64
|
script/generate testbot --connect 192.168.0.100
|
66
65
|
|
67
|
-
rake testbot:spec (or :test, :features)
|
66
|
+
rake testbot:spec (or :rspec, :test, :features)
|
68
67
|
|
69
68
|
Using testbot with Rails 3:
|
70
69
|
|
71
70
|
rails g testbot --connect 192.168.0.100
|
72
|
-
rake testbot:spec (or :test, :features)
|
71
|
+
rake testbot:spec (or :rspec, :test, :features)
|
73
72
|
|
74
73
|
# Gemfile:
|
75
74
|
gem 'testbot'
|
@@ -129,3 +128,4 @@ More
|
|
129
128
|
----
|
130
129
|
|
131
130
|
* Check the [wiki](http://github.com/joakimk/testbot/wiki) for more info.
|
131
|
+
* Chat: [https://convore.com/github/testbot](https://convore.com/github/testbot)
|
@@ -1,14 +1,17 @@
|
|
1
1
|
require File.dirname(__FILE__) + '/rspec_adapter'
|
2
|
+
require File.dirname(__FILE__) + '/rspec2_adapter'
|
2
3
|
require File.dirname(__FILE__) + '/cucumber_adapter'
|
3
4
|
require File.dirname(__FILE__) + '/test_unit_adapter'
|
4
5
|
|
5
6
|
class Adapter
|
6
7
|
def self.all
|
7
|
-
[ RSpecAdapter, CucumberAdapter, TestUnitAdapter ]
|
8
|
+
[ RSpecAdapter, RSpec2Adapter, CucumberAdapter, TestUnitAdapter ]
|
8
9
|
end
|
9
10
|
|
10
11
|
def self.find(type)
|
11
12
|
case type.to_sym
|
13
|
+
when :rspec
|
14
|
+
RSpec2Adapter
|
12
15
|
when :spec
|
13
16
|
RSpecAdapter
|
14
17
|
when :features
|
@@ -6,14 +6,14 @@ class RubyEnv
|
|
6
6
|
|
7
7
|
def self.ruby_command(project_path, opts = {})
|
8
8
|
ruby_interpreter = opts[:ruby_interpreter] || "ruby"
|
9
|
-
|
10
|
-
if File.exists?("#{project_path}/#{opts[:script]}")
|
9
|
+
|
10
|
+
if opts[:script] && File.exists?("#{project_path}/#{opts[:script]}")
|
11
11
|
command = opts[:script]
|
12
12
|
elsif opts[:bin]
|
13
13
|
command = opts[:bin]
|
14
14
|
else
|
15
15
|
command = ruby_interpreter
|
16
|
-
end
|
16
|
+
end
|
17
17
|
|
18
18
|
if bundler?(project_path)
|
19
19
|
"#{ruby_interpreter} -S bundle exec #{command}"
|
@@ -0,0 +1,51 @@
|
|
1
|
+
require File.expand_path(File.join(File.dirname(__FILE__), "/helpers/ruby_env"))
|
2
|
+
|
3
|
+
class RSpec2Adapter
|
4
|
+
|
5
|
+
def self.command(project_path, ruby_interpreter, files)
|
6
|
+
spec_command = RubyEnv.ruby_command(project_path,
|
7
|
+
:bin => "rspec",
|
8
|
+
:ruby_interpreter => ruby_interpreter)
|
9
|
+
|
10
|
+
if File.exists?("#{project_path}/spec/spec.opts")
|
11
|
+
spec_command += " -O spec/spec.opts"
|
12
|
+
end
|
13
|
+
|
14
|
+
"export RSPEC_COLOR=true; #{spec_command} #{files}"
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.test_files(dir)
|
18
|
+
Dir["#{dir}/#{file_pattern}"]
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.get_sizes(files)
|
22
|
+
files.map { |file| File.stat(file).size }
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.requester_port
|
26
|
+
2299
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.pluralized
|
30
|
+
'specs'
|
31
|
+
end
|
32
|
+
|
33
|
+
def self.base_path
|
34
|
+
"spec"
|
35
|
+
end
|
36
|
+
|
37
|
+
def self.name
|
38
|
+
'RSpec2'
|
39
|
+
end
|
40
|
+
|
41
|
+
def self.type
|
42
|
+
'rspec'
|
43
|
+
end
|
44
|
+
|
45
|
+
private
|
46
|
+
|
47
|
+
def self.file_pattern
|
48
|
+
'**/**/*_spec.rb'
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
data/lib/shared/testbot.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require File.expand_path(File.join(File.dirname(__FILE__), '/version'))
|
1
2
|
require File.expand_path(File.join(File.dirname(__FILE__), '/simple_daemonize'))
|
2
3
|
require File.expand_path(File.join(File.dirname(__FILE__), '/adapters/adapter'))
|
3
4
|
require 'fileutils'
|
@@ -5,16 +6,6 @@ require 'fileutils'
|
|
5
6
|
module Testbot
|
6
7
|
require 'railtie' if defined?(Rails)
|
7
8
|
|
8
|
-
# Don't forget to update readme and changelog
|
9
|
-
def self.version
|
10
|
-
version = "0.5.4"
|
11
|
-
dev_version_file = File.join(File.dirname(__FILE__), '..', '..', 'DEV_VERSION')
|
12
|
-
if File.exists?(dev_version_file)
|
13
|
-
version += File.read(dev_version_file)
|
14
|
-
end
|
15
|
-
version
|
16
|
-
end
|
17
|
-
|
18
9
|
if ENV['INTEGRATION_TEST']
|
19
10
|
SERVER_PID = "/tmp/integration_test_testbot_server.pid"
|
20
11
|
RUNNER_PID = "/tmp/integration_test_testbot_runner.pid"
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module Testbot
|
2
|
+
# Don't forget to update readme and changelog
|
3
|
+
def self.version
|
4
|
+
version = "0.5.5"
|
5
|
+
dev_version_file = File.join(File.dirname(__FILE__), '..', '..', 'DEV_VERSION')
|
6
|
+
if File.exists?(dev_version_file)
|
7
|
+
version += File.read(dev_version_file)
|
8
|
+
end
|
9
|
+
version
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
@@ -52,6 +52,11 @@ class RubyEnvTest < Test::Unit::TestCase
|
|
52
52
|
assert_equal 'ruby -S script/spec', RubyEnv.ruby_command("path/to/project", :script => "script/spec", :bin => "rspec")
|
53
53
|
end
|
54
54
|
|
55
|
+
should "not look for a script when none is provided" do
|
56
|
+
flexmock(File).should_receive(:exists?).once # Once for bundler check
|
57
|
+
assert_equal 'ruby -S rspec', RubyEnv.ruby_command("path/to/project", :bin => "rspec")
|
58
|
+
end
|
59
|
+
|
55
60
|
should "be able to use jruby" do
|
56
61
|
flexmock(RubyEnv).should_receive(:bundler?).and_return(false)
|
57
62
|
flexmock(File).should_receive(:exists?).and_return(true)
|
@@ -5,6 +5,7 @@ require 'shoulda'
|
|
5
5
|
class AdapterTest < Test::Unit::TestCase
|
6
6
|
|
7
7
|
should "be able to find the adapters" do
|
8
|
+
assert_equal RSpec2Adapter, Adapter.find(:rspec)
|
8
9
|
assert_equal RSpecAdapter, Adapter.find(:spec)
|
9
10
|
assert_equal CucumberAdapter, Adapter.find(:features)
|
10
11
|
assert_equal TestUnitAdapter, Adapter.find(:test)
|
@@ -15,7 +16,7 @@ class AdapterTest < Test::Unit::TestCase
|
|
15
16
|
end
|
16
17
|
|
17
18
|
should "return be able to all types" do
|
18
|
-
assert_equal [ RSpecAdapter, CucumberAdapter, TestUnitAdapter ], Adapter.all
|
19
|
+
assert_equal [ RSpecAdapter, RSpec2Adapter, CucumberAdapter, TestUnitAdapter ], Adapter.all
|
19
20
|
end
|
20
21
|
|
21
22
|
end
|
data/testbot.gemspec
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: testbot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 1
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 5
|
9
|
-
-
|
10
|
-
version: 0.5.
|
9
|
+
- 5
|
10
|
+
version: 0.5.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- "Joakim Kolsj\xC3\xB6"
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-04-08 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -256,11 +256,13 @@ files:
|
|
256
256
|
- lib/shared/adapters/adapter.rb
|
257
257
|
- lib/shared/adapters/cucumber_adapter.rb
|
258
258
|
- lib/shared/adapters/helpers/ruby_env.rb
|
259
|
+
- lib/shared/adapters/rspec2_adapter.rb
|
259
260
|
- lib/shared/adapters/rspec_adapter.rb
|
260
261
|
- lib/shared/adapters/test_unit_adapter.rb
|
261
262
|
- lib/shared/simple_daemonize.rb
|
262
263
|
- lib/shared/ssh_tunnel.rb
|
263
264
|
- lib/shared/testbot.rb
|
265
|
+
- lib/shared/version.rb
|
264
266
|
- lib/tasks/testbot.rake
|
265
267
|
- lib/testbot.rb
|
266
268
|
- test/fixtures/local/config/testbot.yml
|
@@ -316,7 +318,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
316
318
|
requirements: []
|
317
319
|
|
318
320
|
rubyforge_project:
|
319
|
-
rubygems_version: 1.
|
321
|
+
rubygems_version: 1.5.3
|
320
322
|
signing_key:
|
321
323
|
specification_version: 3
|
322
324
|
summary: A test distribution tool.
|