Permalink
Browse files

Forgot to apply refactor and preloading logic to RunRemote

  • Loading branch information...
1 parent fc15715 commit c866aa152c6627738e123bc82e57d10a63613b9a Luke Melia and Lee Bankewitz committed Dec 7, 2009
Showing with 25 additions and 30 deletions.
  1. +8 −25 lib/testjour/commands/run_remote.rb
  2. +17 −5 lib/testjour/commands/run_slave.rb
@@ -11,33 +11,16 @@ module Testjour
module Commands
class RunRemote < RunSlave
-
- def execute
- configuration.parse!
- configuration.parse_uri!
-
- Dir.chdir(configuration.in) do
- Testjour.setup_logger(configuration.in)
- Testjour.logger.info "Starting run:remote"
-
- rsync
-
- begin
- Testjour.logger.info "Setup"
- configuration.setup
- configuration.setup_mysql
- Testjour.logger.info "Requiring"
- require_files
- Testjour.logger.info "Working"
-
- work
- rescue Object => ex
- Testjour.logger.error "run:remote error: #{ex.message}"
- Testjour.logger.error ex.backtrace.join("\n")
- end
- end
+
+ def dir
+ configuration.in
end
+ def before_require
+ rsync
+ super
+ end
+
def rsync
Rsync.copy_to_current_directory_from(configuration.rsync_uri)
end
@@ -18,23 +18,35 @@ class RunSlave < Command
def execute
configuration.parse!
configuration.parse_uri!
- enable_gc_optimizations
- Dir.chdir(configuration.path) do
- Testjour.setup_logger(configuration.path)
- Testjour.logger.info "Starting run:slave"
+ Dir.chdir(dir) do
+ Testjour.setup_logger(dir)
+ Testjour.logger.info "Starting #{self.class.name}"
+
+ before_require
+
begin
configuration.setup
configuration.setup_mysql
+
require_cucumber_files
preload_app
+
work
rescue Object => ex
- Testjour.logger.error "run:slave error: #{ex.message}"
+ Testjour.logger.error "#{self.class.name} error: #{ex.message}"
Testjour.logger.error ex.backtrace.join("\n")
end
end
end
+
+ def dir
+ configuration.path
+ end
+
+ def before_require
+ enable_gc_optimizations
+ end
def work
queue = RedisQueue.new(configuration.queue_host)

0 comments on commit c866aa1

Please sign in to comment.