I hacked for a while, but finally had to give up and get back to work.
 I added this to my Rakefile:

def self.reconnect
  require 'active_record' unless defined? ActiveRecord
  configurations = ActiveRecord::Base.configurations
  if configurations and configurations.has_key?("test") and
configurations["test"]["adapter"] == 'mysql'
    ActiveRecord::Base.establish_connection(:test)
  end
end

task :cruise => :environment do
  ENV['RAILS_ENV'] = 'test'
  Rake::Task['db:test:purge'].invoke
  reconnect
  Rake::Task['db:migrate'].invoke
  Rake::Task['custom:db:fixtures:load'].invoke
  Rake::Task['custom:test'].invoke
end

And haven't had any issues since.

I feel I should add, in case there's any relavence, I have
'custom:db:fixtures:load' and 'custom:test' tasks because I had to
change the way the fixtures were run.  Specifically, I use what I call
"programmatic" fixtures instead of the standard Rails (YAML) fixtures.
 That's part of the much larger discussion about some of the
tediousness and awkwardness inherent with Rails fixtures.  It's not a
pretty solution, by any means, but it gets the job done.

Sorry I can't provide any precise answer about what is wrong and what
the solution is,

Jason

On Thu, Nov 13, 2008 at 1:30 PM, Steven Hilton <[EMAIL PROTECTED]> wrote:
> Greetings,
>
> I found an email thread on this list that concluded with the message below,
> about tests passing but the build failing.
>
> I'm having the same issue, same behavior, but have tracked it down yet.
> Was wondering if Jason Edwards, or anyone else, has resolved the issue.
> It's not CC-specific,  apparently, but this is where others were seeing my
> problem.
>
> Thanks...
>
> ====
> Bizarre...
>
> I went and added a task to my Rakefile, and I'm able to reproduce the
> problem, outside CC.rb (I got this from looking at the
> tasks/cc_build.rake file):
>
> task :cruise => :environment do
>  Rake::Task['db:test:purge'].invoke
>  Rake::Task['db:migrate'].invoke
>  Rake::Task['test'].invoke
> end
>
> The other suggestion from Jeremy, to set the project.rake_task to
> 'default', allowed the build to pass, however, I'm sure that a
> database change would cause the build to fail, since the 'default'
> task doesn't BiTests Pass, But Build Failszarre...
>
> I went and added a task to my Rakefile, and I'm able to reproduce the
> problem, outside CC.rb (I got this from looking at the
> tasks/cc_build.rake file):
>
> task :cruise => :environment do
>  Rake::Task['db:test:purge'].invoke
>  Rake::Task['db:migrate'].invoke
>  Rake::Task['test'].invoke
> end
>
> The other suggestion from Jeremy, to set the project.rake_task to
> 'default', allowed the build to pass, however, I'm sure that a
> database change would cause the build to fail, since the 'default'
> task doesn't run db:migrate.
>
> So it's not a cruisecontrol issue at all... I'll keep hacking on it,
> maybe find answer...
>
> Thanks,
>
> Jason
> run db:migrate.
>
> So it's not a cruisecontrol issue at all... I'll keep hacking on it,
> maybe find answer...
>
> Thanks,
>
> Jason
> ===
>
>
> --
> Steven Hilton <[EMAIL PROTECTED]>
> <http://mshiltonj.com/>
>
> "It is the duty of the patriot to protect
>  his country from its government." -- Thomas Paine
>
> "Those who make peaceful revolution impossible
>  will make violent revolution inevitable."   --  John F. Kennedy
>
> "There is no heart so black
>  as the black, black heart
>  of the phony leper." -- Adrian Monk
> _______________________________________________
> Cruisecontrolrb-users mailing list
> [email protected]
> http://rubyforge.org/mailman/listinfo/cruisecontrolrb-users
>
_______________________________________________
Cruisecontrolrb-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/cruisecontrolrb-users

Reply via email to