Hi,
I added (project.rake_task = "spec:controllers spec:models") in my
project
cruise_config.rb file but there is something strange is going on.
1:It invoke the spec:controllers task,some of the tests failed but it does
not start the spec:models task
2:When the build is started i can see that it is executing db:test:purge and
db:test:load twice.Actually it should be doing once.
I am attaching the whole trace which might help you.
Build was manually requested
BUILD LOG
---------
/root/.cruise/projects/
BrandPotion/work root$ ruby -e "require ''rubygems'' rescue
nil; require
''rake''; load
''/home/amit/cruisecontrol-1.4.0/cruisecontrol-1.4.0/tasks/cc_build.rake'';
ARGV << ''--nosearch'' <<
''--trace'' << ''cc:build'';
Rake.application.run;
ARGV.clear"
(in /root/.cruise/projects/BrandPotion/work)
** Invoke cc:build (first_time)
** Execute cc:build
[CruiseControl] Invoking Rake task "spec:controllers"
** Invoke spec:controllers (first_time)
** Invoke db:test:prepare (first_time)
** Invoke db:abort_if_pending_migrations (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:abort_if_pending_migrations
** Execute db:test:prepare
** Invoke db:test:load (first_time)
** Invoke db:test:purge (first_time)
** Invoke environment
** Execute db:test:purge
** Execute db:test:load
** Invoke db:schema:load (first_time)
** Invoke environment
** Execute db:schema:load
** Execute spec:controllers
FFFFFF............FF.............FFFFF..............FF........................F.FFFF............FFF.FFFFFFF.....................................................FFFFFF...............FFF............FFF.............................F.FF.........................FFFFFFFFF..FFFFF..................FF...................FFFF...FF.F.FFF.F...FFF....FFFF...FF.F.FFF.F...FFF.FF.FF.FF......FF.FF..........F...FF..FFFFF.....................FFF........F.................................................................FF.FF.....FF...FFFF...FF.F.FFF.F....FF.FFFFF.F....FFFF...FF.F.FFF.F........FFF..F.FFF.........FFFFF....FF..FFFFF.F...
On Tue, Jan 19, 2010 at 9:58 PM, Brian Guthrie <btguthrie at gmail.com>
wrote:
> Hi Amit,
>
> If you''d like CCRB to execute more than one rake task, either
place
> them in sequence (project.rake_task = "spec:controllers
spec:models")
> or define a custom Rake task that runs both tasks as its prerequisites
> (task :cruise => ["spec:controllers",
"spec:models"]). If you define a
> task named cruise in your project then you don''t need to manually
set
> your project''s Rake task.
>
> /contests_controller_spec.rb" --options "/root/.cruise/projects/
BrandPotion/work/spec/spec.opts" failed
/usr/local/lib/ruby/gems/1.8/gems/rspec-1.1.12/lib/spec/rake/spectask.rb:175:in
`define''
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1112:in
`verbose''
/usr/local/lib/ruby/gems/1.8/gems/rspec-1.1.12/lib/spec/rake/spectask.rb:151:in
`define''
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call''
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in
`execute''
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each''
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in
`execute''
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in
`invoke_with_call_chain''
/usr/local/lib/ruby/1.8/monitor.rb:242:in `synchronize''
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in
`invoke_with_call_chain''
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in
`invoke''
/home/amit/cruisecontrol-1.4.0/cruisecontrol-1.4.0/tasks/cc_build.rake:5:in
`invoke_rake_task''
/home/amit/cruisecontrol-1.4.0/cruisecontrol-1.4.0/tasks/cc_build.rake:31
/home/amit/cruisecontrol-1.4.0/cruisecontrol-1.4.0/tasks/cc_build.rake:31:in
`each''
/home/amit/cruisecontrol-1.4.0/cruisecontrol-1.4.0/tasks/cc_build.rake:31
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call''
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in
`execute''
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each''
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in
`execute''
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in
`invoke_with_call_chain''
/usr/local/lib/ruby/1.8/monitor.rb:242:in `synchronize''
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in
`invoke_with_call_chain''
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in
`invoke''
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in
`invoke_task''
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in
`top_level''
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each''
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in
`top_level''
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in
`standard_exception_handling''
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in
`top_level''
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run''
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in
`standard_exception_handling''
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run''
-e:1
dir : /root/.cruise/projects/BrandPotion/work
command : echo /root/.cruise/projects/BrandPotion/work root$ ruby\ -e\
\"require\ \''rubygems\''\ rescue\ nil\;\ require\
\''rake\''\;\ load\
\''/home/amit/cruisecontrol-1.4.0/cruisecontrol-1.4.0/tasks/cc_build.rake\''\;\
ARGV\ \<\<\ \''--nosearch\''\ \<\<\
\''--trace\''\ \<\<\ \''cc:build\''\;\
Rake.application.run\;\ ARGV.clear\" >>
/root/.cruise/projects/BrandPotion/build-1556.22/build.log && ruby -e
"require ''rubygems'' rescue nil; require
''rake''; load
''/home/amit/cruisecontrol-1.4.0/cruisecontrol-1.4.0/tasks/cc_build.rake'';
ARGV << ''--nosearch'' <<
''--trace'' << ''cc:build'';
Rake.application.run;
ARGV.clear" >>
/root/.cruise/projects/BrandPotion/build-1556.22/build.log
2>&1
exitstatus: 1
PROJECT SETTINGS
----------------
# Project-specific configuration for CruiseControl.rb
Project.configure do |project|
project.email_notifier.emails = ["amit at joshsoftware.com"]
project.email_notifier.from = ["testing at joshsoftware.com"]
# Build the project by invoking rake task ''custom''
(project.rake_task = ''spec:controllers spec:models'')
# project.rake_task = ''spec:models''
# Build the project by invoking shell script "build_my_app.sh". Keep
in
mind that when the script is invoked,
# current working directory is
<em>[cruise data]</em>/projects/your_project/work, so if
you do not
keep build_my_app.sh
# in version control, it should be ''../build_my_app.sh''
instead
# project.build_command = ''build_my_app.sh''
# Ping Subversion for new revisions every 5 minutes (default: 30 seconds)
# project.scheduler.polling_interval = 5.minutes
end
3:How can i define custom rake task mentioned above in my project and how
can i execute that when i build the project?
> Brian
>
> On Tue, Jan 19, 2010 at 8:16 AM, Amit Kulkarni
> <amitkkulkarni.84 at gmail.com> wrote:
> > Hello,
> > I have set up a project and under myproject/cruise_config.rb i had
> written
> > following code:
> > Project.configure do |project|
> > project.email_notifier.emails = ["amit at
joshsoftware.com"]
> > project.email_notifier.from = ["testing at
joshsoftware.com"]
> > # Build the project by invoking rake task ''custom''
> > project.rake_task = ''spec:controllers''
> > end
> >
> > This works correctly as it sends me the email and also runs controller
> > specs.
> > Now i what i intended to do is to run model specs as well for the same
> > project.
> >
> > i just added project.rake_task = ''spec:models'' after
controllers but when
> i
> > build then it runs model spec first and does not run controller specs.
> >
> > Is it the case that if some of my model specs are failing then it will
> not
> > execute controller specs?
> > Please suggest.
> >
> >
> >
> > _______________________________________________
> > Cruisecontrolrb-users mailing list
> > Cruisecontrolrb-users at rubyforge.org
> > http://rubyforge.org/mailman/listinfo/cruisecontrolrb-users
> >
> >
> _______________________________________________
> Cruisecontrolrb-users mailing list
> Cruisecontrolrb-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/cruisecontrolrb-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://rubyforge.org/pipermail/cruisecontrolrb-users/attachments/20100120/58229bec/attachment-0001.html>