views:

39

answers:

1

Hi, I'm trying to setup integrity for my project. Sadly, my bash-fu is poor so I need some help. In build script I enter rake spec. In integrity it returns status 0 and output

(in /home/rails/integrity/builds/builds/66)

but I know, that I should got status 1 and output (after running it manually from console):

rails@integrity:~/integrity/builds/builds/66$ rake spec
(in /home/rails/integrity/builds/builds/66) rake aborted! No such file or directory - /home/rails/integrity/builds/builds/66/config/database.yml

(See full trace by running task with --trace)

I dont create database.yml, becouse I would like to Integrity show message about it?

For me it looks like it lost pipe. Script is running here: http://github.com/integrity/integrity/blob/v22/lib/integrity/builder.rb#L49 Could you tell why rake spec in integrity returns 0?

A: 

You need to have database.yml set before you can run your tests. You can write a custom build script that will set it and then run the test. Something like:

namespace :ci do
  task :update_submodules do
    system("git submodule update -i")
  end

  task :copy_yml do
    system("cp /my/custom/config/path/database.yml.ci #{Rails.root}/config/database.yml")
  end

  desc "Prepare for CI and run entire test suite"
    task :build => [:environment, 'ci:update_submodules', 'ci:copy_yml', 'spec', 'cucumber:ok'] do
  end

end

And then put rake ci:build as integrity build script. Basically this script will copy a database.yml template before launching the tests.

hellvinz