cucumber 0.8.5 and warmsnake (experimental)

This commit is contained in:
Nick Gauthier 2010-08-20 15:43:56 -04:00
parent cc23eb35c4
commit d4f1bf59d2
4 changed files with 65 additions and 61 deletions

View File

@ -12,7 +12,7 @@ begin
gem.authors = ["Nick Gauthier"] gem.authors = ["Nick Gauthier"]
gem.add_development_dependency "shoulda", "= 2.10.3" gem.add_development_dependency "shoulda", "= 2.10.3"
gem.add_development_dependency "rspec", "= 1.3.0" gem.add_development_dependency "rspec", "= 1.3.0"
gem.add_development_dependency "cucumber", "= 0.7.2" gem.add_development_dependency "cucumber", "= 0.8.5"
gem.add_development_dependency "therubyracer", "= 0.7.4" gem.add_development_dependency "therubyracer", "= 0.7.4"
end end
Jeweler::GemcutterTasks.new Jeweler::GemcutterTasks.new

View File

@ -1,62 +1,64 @@
#!/usr/bin/env ruby #!/usr/bin/env ruby
if File.expand_path($0) == File.expand_path(__FILE__)
require 'rubygems' require 'rubygems'
require 'hydra' require 'hydra'
@files = ARGV.inject([]){|memo,f| memo += Dir.glob f} @files = ARGV.inject([]){|memo,f| memo += Dir.glob f}
if @files.empty? if @files.empty?
puts "You must specify a list of files to run" puts "You must specify a list of files to run"
puts "If you specify a pattern, it must be in quotes" puts "If you specify a pattern, it must be in quotes"
puts %{USAGE: #{$0} test/unit/my_test.rb "test/functional/**/*_test.rb"} puts %{USAGE: #{$0} test/unit/my_test.rb "test/functional/**/*_test.rb"}
exit(1) exit(1)
end end
Signal.trap("TERM", "KILL") do Signal.trap("TERM", "KILL") do
puts "Warm Snake says bye bye" puts "Warm Snake says bye bye"
exit(0) exit(0)
end end
bold_yellow = "\033[1;33m" bold_yellow = "\033[1;33m"
reset = "\033[0m" reset = "\033[0m"
loop do loop do
env_proc = Process.fork do env_proc = Process.fork do
puts "#{bold_yellow}Booting Environment#{reset}" puts "#{bold_yellow}Booting Environment#{reset}"
start = Time.now
ENV['RAILS_ENV']='test'
require 'config/environment'
require 'test/test_helper'
finish = Time.now
puts "#{bold_yellow}Environment Booted (#{finish-start})#{reset}"
loop do
puts "#{bold_yellow}Running#{reset} [#{@files.inspect}]"
start = Time.now start = Time.now
Hydra::Master.new( ENV['RAILS_ENV']='test'
:files => @files.dup, require 'config/environment'
:listeners => Hydra::Listener::ProgressBar.new(STDOUT), require 'test/test_helper'
:workers => [{:type => :local, :runners => 4}]
)
finish = Time.now finish = Time.now
puts "#{bold_yellow}Tests finished#{reset} (#{finish-start})" puts "#{bold_yellow}Environment Booted (#{finish-start})#{reset}"
puts "" loop do
puts "#{bold_yellow}Running#{reset} [#{@files.inspect}]"
$stdout.write "Press #{bold_yellow}ENTER#{reset} to retest. Type #{bold_yellow}r#{reset} then hit enter to reboot environment. #{bold_yellow}CTRL-C#{reset} to quit\n> " start = Time.now
begin Hydra::Master.new(
command = $stdin.gets :files => @files.dup,
rescue Interrupt :listeners => Hydra::Listener::ProgressBar.new(STDOUT),
exit(0) :workers => [{:type => :local, :runners => 4}]
)
finish = Time.now
puts "#{bold_yellow}Tests finished#{reset} (#{finish-start})"
puts ""
$stdout.write "Press #{bold_yellow}ENTER#{reset} to retest. Type #{bold_yellow}r#{reset} then hit enter to reboot environment. #{bold_yellow}CTRL-C#{reset} to quit\n> "
begin
command = $stdin.gets
rescue Interrupt
exit(0)
end
break if !command.nil? and command.chomp == "r"
end end
break if !command.nil? and command.chomp == "r" end
begin
Process.wait env_proc
rescue Interrupt
puts "\n#{bold_yellow}SSsssSsssSSssSs#{reset}"
break
end end
end end
begin
Process.wait env_proc
rescue Interrupt
puts "\n#{bold_yellow}SSsssSsssSSssSs#{reset}"
break
end
end end

View File

@ -9,9 +9,11 @@ Gem::Specification.new do |s|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Nick Gauthier"] s.authors = ["Nick Gauthier"]
s.date = %q{2010-07-08} s.date = %q{2010-08-20}
s.default_executable = %q{warmsnake.rb}
s.description = %q{Spread your tests over multiple machines to test your code faster.} s.description = %q{Spread your tests over multiple machines to test your code faster.}
s.email = %q{nick@smartlogicsolutions.com} s.email = %q{nick@smartlogicsolutions.com}
s.executables = ["warmsnake.rb"]
s.extra_rdoc_files = [ s.extra_rdoc_files = [
"LICENSE", "LICENSE",
"README.rdoc", "README.rdoc",
@ -25,6 +27,7 @@ Gem::Specification.new do |s|
"Rakefile", "Rakefile",
"TODO", "TODO",
"VERSION", "VERSION",
"bin/warmsnake.rb",
"caliper.yml", "caliper.yml",
"hydra-icon-64x64.png", "hydra-icon-64x64.png",
"hydra.gemspec", "hydra.gemspec",
@ -110,18 +113,18 @@ Gem::Specification.new do |s|
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
s.add_development_dependency(%q<shoulda>, ["= 2.10.3"]) s.add_development_dependency(%q<shoulda>, ["= 2.10.3"])
s.add_development_dependency(%q<rspec>, ["= 1.3.0"]) s.add_development_dependency(%q<rspec>, ["= 1.3.0"])
s.add_development_dependency(%q<cucumber>, ["= 0.7.2"]) s.add_development_dependency(%q<cucumber>, ["= 0.8.5"])
s.add_development_dependency(%q<therubyracer>, ["= 0.7.4"]) s.add_development_dependency(%q<therubyracer>, ["= 0.7.4"])
else else
s.add_dependency(%q<shoulda>, ["= 2.10.3"]) s.add_dependency(%q<shoulda>, ["= 2.10.3"])
s.add_dependency(%q<rspec>, ["= 1.3.0"]) s.add_dependency(%q<rspec>, ["= 1.3.0"])
s.add_dependency(%q<cucumber>, ["= 0.7.2"]) s.add_dependency(%q<cucumber>, ["= 0.8.5"])
s.add_dependency(%q<therubyracer>, ["= 0.7.4"]) s.add_dependency(%q<therubyracer>, ["= 0.7.4"])
end end
else else
s.add_dependency(%q<shoulda>, ["= 2.10.3"]) s.add_dependency(%q<shoulda>, ["= 2.10.3"])
s.add_dependency(%q<rspec>, ["= 1.3.0"]) s.add_dependency(%q<rspec>, ["= 1.3.0"])
s.add_dependency(%q<cucumber>, ["= 0.7.2"]) s.add_dependency(%q<cucumber>, ["= 0.8.5"])
s.add_dependency(%q<therubyracer>, ["= 0.7.4"]) s.add_dependency(%q<therubyracer>, ["= 0.7.4"])
end end
end end

View File

@ -19,7 +19,6 @@ module Cucumber #:nodoc:
print_steps(:failed) print_steps(:failed)
print_snippets(@options) print_snippets(@options)
print_passing_wip(@options) print_passing_wip(@options)
print_tag_limit_warnings(features)
end end
# Removed all progress output # Removed all progress output