Rakerunner and shell commands

Apologies if this is listed somewhere -- I can't find a search box...

TeamCity Enterprise 4.0 (build 8080)

We are having a problem running rake tasks. It appears related to invoking a shell command from a task, for example a task that prints the cucumber help file may include a line like:

ruby("C:/ruby/lib/ruby/gems/1.8/gems/cucumber-0.3.1/bin/cucumber", "-h") 
 
Here's the type of result we get:
 


[11:58:26]: Execute simple (1s)
[11:58:26]: [Execute simple] [2009-04-30T11:58:26+01:00] Simple task
[11:58:26]: [Execute simple] [2009-04-30T11:58:26+01:00] printing cucumber help file...
[11:58:26]: [Execute simple]
c:/ruby/bin/ruby 'C:/ruby/lib/ruby/gems/1.8/gems/cucumber-0.3.1/bin/cucumber' '-h'
[11:58:26]: [Execute simple]  timestamp= '2009-04-30|'T|'11:58:26.951+0100'
[11:58:27]: [Execute simple] Usage: cucumber [options] [ [FILE|DIR|URL][:LINE[:LINE]*] ]+
[11:58:27]: [Execute simple] [...rest of cucumber help file elided...]
[11:58:28]: [Execute simple] [2009-04-30T11:58:28+01:00] Done
[11:58:28]: Process exit code: 0
 

 
So, because if those red lines, our whole build fails -- even though the process actually succeeded.
 

 
Any ideas?
 

 
And also, the rakefile is deleted for some reason after failure.
 

 
<bb />
6 comments
Comment actions Permalink

We did find the reason for the errors.

In the teamcity rakerunner source (rake_ext.rb), there is an overriden operation RakeFileUtils.rake_output_message which emits an error, even for regular output logging. If we change this to no longer output error, then our tests pass.

Interestingly, the implementation it overrides also appears to write to stderror -- even though the method is named rake_output_message. So it does appear to be intended behaviour.

0
Comment actions Permalink

Partial solution

We are invoking Rake.FileUtils.sh to issue shell commands -- this invokes rake_output_message when running in verbose mode.

And then rake_output_message logs this is an error for whatever reason.

0
Comment actions Permalink

Could you please submit a bug report: http://jetbrains.net/tracker ?

0
Comment actions Permalink

Okay, done.

Thanks

<bb />

0
Comment actions Permalink

Hello Ben,

Actually this bug was fixed in Calcutta 4.0.1, see http://www.jetbrains.net/tracker/issue2/TW-6289. New implementation doesn't change default behavior of rake_output_message method.

0
Comment actions Permalink

Okay, thanks -- apologies for the duplication.

<bb />

0

Please sign in to leave a comment.