From: <jh...@us...> - 2009-02-06 17:22:22
|
Revision: 63 http://etch.svn.sourceforge.net/etch/?rev=63&view=rev Author: jheiss Date: 2009-02-06 17:22:19 +0000 (Fri, 06 Feb 2009) Log Message: ----------- Fix up the way in which debug is activated. Previously it changed the variable that was passed to us, possibly messing up the caller if it used that variable again later. Modified Paths: -------------- trunk/test/etchtest.rb Modified: trunk/test/etchtest.rb =================================================================== --- trunk/test/etchtest.rb 2009-02-06 17:20:51 UTC (rev 62) +++ trunk/test/etchtest.rb 2009-02-06 17:22:19 UTC (rev 63) @@ -54,6 +54,7 @@ sleep(5) else Dir.chdir('../server/trunk') + #Dir.chdir('../server/branches/libxml') # Causes ruby to fork, so we're left with a useless pid #exec("./script/server -d -p #{port}") # Causes ruby to invoke a copy of sh to run the command (to handle @@ -70,7 +71,7 @@ end def run_etch(port, testbase, errors_expected=false, extra_args='') - #extra_args << " --debug" + #extra_args = extra_args + " --debug" if errors_expected # Warn the user that errors are expected. Otherwise it can be # disconcerting if you're watching the tests run and see errors. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jh...@us...> - 2009-09-23 17:57:07
|
Revision: 102 http://etch.svn.sourceforge.net/etch/?rev=102&view=rev Author: jheiss Date: 2009-09-23 17:56:52 +0000 (Wed, 23 Sep 2009) Log Message: ----------- Use unicorn or script/server for testing based on a constant. Modified Paths: -------------- trunk/test/etchtest.rb Modified: trunk/test/etchtest.rb =================================================================== --- trunk/test/etchtest.rb 2009-09-23 01:07:42 UTC (rev 101) +++ trunk/test/etchtest.rb 2009-09-23 17:56:52 UTC (rev 102) @@ -45,6 +45,7 @@ FileUtils.rm_rf(repodir) end + UNICORN = false def start_server(repodir) ENV['etchserverbase'] = repodir # Pick a random port in the 3001-6000 range (range somewhat randomly chosen) @@ -54,13 +55,11 @@ sleep(5) else Dir.chdir('../server') - # FIXME: silence the server (see various failed attempts...) - # Causes ruby to fork, so we're left with a useless pid - #exec("./script/server -d -p #{port}") - # Causes ruby to invoke a copy of sh to run the command (to handle - # the redirect), which gets in the way of killing things - #exec("./script/server -p #{port} > /dev/null") - exec("./script/server -p #{port}") + if UNICORN + exec("unicorn_rails -p #{port}") + else + exec("./script/server -p #{port}") + end end [port, pid] end This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jh...@us...> - 2009-11-06 00:43:56
|
Revision: 136 http://etch.svn.sourceforge.net/etch/?rev=136&view=rev Author: jheiss Date: 2009-11-06 00:43:46 +0000 (Fri, 06 Nov 2009) Log Message: ----------- Comment out the sleep after the "errors expected" warning. It slows down a test run for little benefit, as folks probably aren't watching the tests run most of the time, just starting a run in a window and checking later to make sure nothing failed. Modified Paths: -------------- trunk/test/etchtest.rb Modified: trunk/test/etchtest.rb =================================================================== --- trunk/test/etchtest.rb 2009-11-03 02:04:24 UTC (rev 135) +++ trunk/test/etchtest.rb 2009-11-06 00:43:46 UTC (rev 136) @@ -80,7 +80,7 @@ puts "#" puts "# Errors expected here" puts "#" - sleep 3 + #sleep 3 end result = system("ruby ../client/etch --generate-all --server=http://localhost:#{port} --test-base=#{testbase} --key=keys/testkey #{extra_args}") if errors_expected This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jh...@us...> - 2010-01-05 01:24:05
|
Revision: 187 http://etch.svn.sourceforge.net/etch/?rev=187&view=rev Author: jheiss Date: 2010-01-05 01:23:56 +0000 (Tue, 05 Jan 2010) Log Message: ----------- Fix setting of CLIENTDIR and SERVERDIR to better handle relative paths. Modified Paths: -------------- trunk/test/etchtest.rb Modified: trunk/test/etchtest.rb =================================================================== --- trunk/test/etchtest.rb 2009-12-17 04:36:21 UTC (rev 186) +++ trunk/test/etchtest.rb 2010-01-05 01:23:56 UTC (rev 187) @@ -8,8 +8,8 @@ module EtchTests # Roughly ../server and ../client - SERVERDIR = "#{File.dirname(File.dirname(__FILE__))}/server" - CLIENTDIR = "#{File.dirname(File.dirname(__FILE__))}/client" + SERVERDIR = "#{File.dirname(File.dirname(File.expand_path(__FILE__)))}/server" + CLIENTDIR = "#{File.dirname(File.dirname(File.expand_path(__FILE__)))}/client" # Haven't found a Ruby method for creating temporary directories, # so create a temporary file and replace it with a directory. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jh...@us...> - 2010-03-31 01:29:52
|
Revision: 203 http://etch.svn.sourceforge.net/etch/?rev=203&view=rev Author: jheiss Date: 2010-03-31 01:29:46 +0000 (Wed, 31 Mar 2010) Log Message: ----------- Fix the logic in start_server so that we call close! on the Tempfile before repurposing it. Otherwise we risk having Tempfile do its automatic cleanup later on if the object hasn't yet be destroyed. Modified Paths: -------------- trunk/test/etchtest.rb Modified: trunk/test/etchtest.rb =================================================================== --- trunk/test/etchtest.rb 2010-03-30 23:54:35 UTC (rev 202) +++ trunk/test/etchtest.rb 2010-03-31 01:29:46 UTC (rev 203) @@ -71,13 +71,15 @@ def start_server(repo='no_repo_yet') # We want the running server's notion of the server base to be a symlink # that we can easily change later in swap_repository. - serverbase = Tempfile.new('etchtest').path - File.delete(serverbase) + serverbasefile = Tempfile.new('etchtest') + serverbase = serverbasefile.path + serverbasefile.close! File.symlink(repo, serverbase) ENV['etchserverbase'] = serverbase # Pick a random port in the 3001-6000 range (range somewhat randomly chosen) port = 3001 + rand(3000) if pid = fork + # FIXME: replace this with a check that the server has started puts "Giving the server some time to start up" sleep(5) else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jh...@us...> - 2010-10-05 00:21:29
|
Revision: 215 http://etch.svn.sourceforge.net/etch/?rev=215&view=rev Author: jheiss Date: 2010-10-05 00:21:22 +0000 (Tue, 05 Oct 2010) Log Message: ----------- Add a port argument to the run_etch method to allow callers to specify a port other than the one the server is listening on. Modified Paths: -------------- trunk/test/etchtest.rb Modified: trunk/test/etchtest.rb =================================================================== --- trunk/test/etchtest.rb 2010-10-05 00:19:13 UTC (rev 214) +++ trunk/test/etchtest.rb 2010-10-05 00:21:22 UTC (rev 215) @@ -74,6 +74,11 @@ def get_server(newrepo=nil) if !@@server @@server = start_server + # FIXME: This doesn't get called for some reason, I suspect TestTask or + # Test::Unit are interfering since they probably also use trap to + # implement their magic. As a result we end up leaving the server + # running in the background. + trap("EXIT") { stop_server(@@server) } end if newrepo swap_repository(@@server, newrepo) @@ -117,8 +122,11 @@ Process.waitpid(server[:pid]) end - def run_etch(server, testbase, errors_expected=false, extra_args='') + def run_etch(server, testbase, errors_expected=false, extra_args='', port=nil) extra_args = extra_args + " --debug" + if !port + port = server[:port] + end if errors_expected # Warn the user that errors are expected. Otherwise it can be # disconcerting if you're watching the tests run and see errors. @@ -128,7 +136,7 @@ puts "#" #sleep 3 end - result = system("ruby #{CLIENTDIR}/etch --generate-all --server=http://localhost:#{server[:port]} --test-base=#{testbase} --key=#{File.dirname(__FILE__)}/keys/testkey #{extra_args}") + result = system("ruby #{CLIENTDIR}/etch --generate-all --server=http://localhost:#{port} --test-base=#{testbase} --key=#{File.dirname(__FILE__)}/keys/testkey #{extra_args}") if errors_expected assert(!result) else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jh...@us...> - 2011-05-04 05:37:18
|
Revision: 275 http://etch.svn.sourceforge.net/etch/?rev=275&view=rev Author: jheiss Date: 2011-05-04 05:37:12 +0000 (Wed, 04 May 2011) Log Message: ----------- Ensure that the client and server are invoked with the same ruby the user used to invoke the test suite. This allows us to test etch under various ruby versions, etc. Modified Paths: -------------- trunk/test/etchtest.rb Modified: trunk/test/etchtest.rb =================================================================== --- trunk/test/etchtest.rb 2011-05-04 05:02:05 UTC (rev 274) +++ trunk/test/etchtest.rb 2011-05-04 05:37:12 UTC (rev 275) @@ -6,7 +6,10 @@ require 'tempfile' require 'fileutils' require 'net/http' +require 'rbconfig' +RUBY = File.join(*RbConfig::CONFIG.values_at("bindir", "ruby_install_name")) + RbConfig::CONFIG["EXEEXT"] + module EtchTests # Roughly ../server and ../client SERVERDIR = "#{File.dirname(File.dirname(File.expand_path(__FILE__)))}/server" @@ -47,7 +50,8 @@ repo = tempdir # Put the basic files into that directory needed for a basic etch tree - FileUtils.cp_r(Dir.glob("#{File.dirname(__FILE__)}/testrepo/*"), repo) + # :preserve to maintain executable permissions on the scripts + FileUtils.cp_r(Dir.glob("#{File.dirname(__FILE__)}/testrepo/*"), repo, :preserve => true) hostname = `facter fqdn`.chomp nodegroups_string = '' @@ -127,9 +131,9 @@ end else if UNICORN - exec("cd #{SERVERDIR} && unicorn_rails -p #{port}") + exec("cd #{SERVERDIR} && #{RUBY} `which unicorn_rails` -p #{port}") else - exec("cd #{SERVERDIR} && ./script/server -p #{port}") + exec("cd #{SERVERDIR} && #{RUBY} ./script/server -p #{port}") end end {:port => port, :pid => pid, :repo => serverbase} @@ -171,7 +175,7 @@ puts "#" #sleep 3 end - result = system("ruby #{CLIENTDIR}/etch --generate-all --test-root=#{testroot} #{server} #{key} #{extra_args}") + result = system("#{RUBY} #{CLIENTDIR}/etch --generate-all --test-root=#{testroot} #{server} #{key} #{extra_args}") if options[:errors_expected] assert(!result, options[:testname]) else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jh...@us...> - 2011-05-04 22:11:34
|
Revision: 282 http://etch.svn.sourceforge.net/etch/?rev=282&view=rev Author: jheiss Date: 2011-05-04 22:11:29 +0000 (Wed, 04 May 2011) Log Message: ----------- Update to reflect client directory structure changes Modified Paths: -------------- trunk/test/etchtest.rb Modified: trunk/test/etchtest.rb =================================================================== --- trunk/test/etchtest.rb 2011-05-04 22:07:14 UTC (rev 281) +++ trunk/test/etchtest.rb 2011-05-04 22:11:29 UTC (rev 282) @@ -175,7 +175,7 @@ puts "#" #sleep 3 end - result = system("#{RUBY} #{CLIENTDIR}/etch --generate-all --test-root=#{testroot} #{server} #{key} #{extra_args}") + result = system("#{RUBY} -I #{CLIENTDIR}/lib #{CLIENTDIR}/bin/etch --generate-all --test-root=#{testroot} #{server} #{key} #{extra_args}") if options[:errors_expected] assert(!result, options[:testname]) else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jh...@us...> - 2011-10-13 20:21:30
|
Revision: 303 http://etch.svn.sourceforge.net/etch/?rev=303&view=rev Author: jheiss Date: 2011-10-13 20:21:24 +0000 (Thu, 13 Oct 2011) Log Message: ----------- In stop_server method send SIGKILL if SIGTERM doesn't do the trick. unicorn will exit with just TERM, but webrick needs a KILL. Modified Paths: -------------- trunk/test/etchtest.rb Modified: trunk/test/etchtest.rb =================================================================== --- trunk/test/etchtest.rb 2011-10-13 20:20:31 UTC (rev 302) +++ trunk/test/etchtest.rb 2011-10-13 20:21:24 UTC (rev 303) @@ -141,7 +141,13 @@ def stop_server(server) Process.kill('TERM', server[:pid]) - Process.waitpid(server[:pid]) + sleep 1 + r = Process.waitpid(server[:pid], Process::WNOHANG) + # SIGTERM is fine for unicorn but webrick doesn't die easily + if !r + Process.kill('KILL', server[:pid]) + Process.waitpid(server[:pid]) + end end def run_etch(server, testroot, options={}) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jh...@us...> - 2012-04-28 01:31:26
|
Revision: 333 http://etch.svn.sourceforge.net/etch/?rev=333&view=rev Author: jheiss Date: 2012-04-28 01:31:19 +0000 (Sat, 28 Apr 2012) Log Message: ----------- Run unicorn based on whether the user has enabled it in their Gemfile rather than based on a hard-coded constant in the test suite. Modified Paths: -------------- trunk/test/etchtest.rb Modified: trunk/test/etchtest.rb =================================================================== --- trunk/test/etchtest.rb 2012-04-28 01:26:02 UTC (rev 332) +++ trunk/test/etchtest.rb 2012-04-28 01:31:19 UTC (rev 333) @@ -97,7 +97,6 @@ File.symlink(newrepo, server[:repo]) end - UNICORN = false def start_server(repo='no_repo_yet') # We want the running server's notion of the server base to be a symlink # that we can easily change later in swap_repository. @@ -130,10 +129,10 @@ raise "Etch server failed to start" end else - if UNICORN - exec("cd #{SERVERDIR} && #{RUBY} `which unicorn_rails` -p #{port}") + if `cd #{SERVERDIR} && #{RUBY} \`which bundle\` list`.include?('unicorn') + exec("cd #{SERVERDIR} && #{RUBY} `which bundle` exec unicorn -p #{port}") else - exec("cd #{SERVERDIR} && #{RUBY} `which rails` server -p #{port}") + exec("cd #{SERVERDIR} && #{RUBY} `which bundle` exec rails server -p #{port}") end end {:port => port, :pid => pid, :repo => serverbase} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |