* adding build server debug statements

This commit is contained in:
Seth Call 2014-04-11 01:56:12 +00:00
parent e983e3d186
commit 4e8af1cf32
1 changed files with 22 additions and 0 deletions

View File

@ -1,3 +1,11 @@
# temporary to debug failing tests on the build server
def bputs(msg)
if ENV["BUILD_PUTS"] == "1"
puts msg
end
end
require 'simplecov'
require 'rubygems'
#require 'spork'
@ -7,18 +15,27 @@ require 'omniauth'
ENV["RAILS_ENV"] ||= 'test'
bputs "before activerecord load"
require 'active_record'
require 'action_mailer'
require 'jam_db'
require "#{File.dirname(__FILE__)}/spec_db"
bputs "before db_config load"
# recreate test database and migrate it
db_config = YAML::load(File.open('config/database.yml'))["test"]
# initialize ActiveRecord's db connection\
bputs "before recreate db"
SpecDb::recreate_database(db_config)
bputs "before connect db"
ActiveRecord::Base.establish_connection(YAML::load(File.open('config/database.yml'))["test"])
bputs "before load jam_ruby"
require 'jam_ruby'
# uncomment this to see active record logs
@ -41,6 +58,8 @@ Thread.new {
end
}
bputs "before load websocket server"
current = Thread.current
Thread.new do
ActiveRecord::Base.connection.disconnect!
@ -59,8 +78,11 @@ Thread.new do
puts "websocket-gateway failed: #{e}"
end
end
bputs "before websocket thread wait"
Thread.stop
bputs "before conneciton reestablish"
ActiveRecord::Base.connection.disconnect!
ActiveRecord::Base.establish_connection(YAML::load(File.open('config/database.yml'))["test"])