Spec::Rake::SpecTask failing under IronRuby 0.6
This problem has been solved.
Tried the same setup with regular Ruby, worked fine. It's unclear to me whether this is a problem internal to IronRuby or a configuration issue. Any input would be greatly appreciated.
Stacktrace below.
Execute spec (5s)
[01:20:55]: [Execute spec]
RuntimeError: Command C:/IronRuby/lib/IronRuby/../..//bin/ir.exe -I"C:/IronRuby/lib/ironruby/gems/1.8/gems/rspec-1.2.7/lib" "C:/IronRuby/lib/ironruby/gems/1.8/gems/rspec-1.2.7/bin/spec" "my_spec.rb" --require 'teamcity/spec/runner/formatter/teamcity/formatter' --format Spec::Runner::Formatter::TeamcityFormatter:matrix failed
Stacktrace:
C:/IronRuby/lib/ironruby/gems/1.8/gems/rspec-1.2.7/lib/spec/rake/spectask.rb:16707566:in `define'
C:/IronRuby/lib/ironruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1112:in `verbose'
C:/IronRuby/lib/ironruby/gems/1.8/gems/rspec-1.2.7/lib/spec/rake/spectask.rb:153:in `define'
C:/IronRuby/lib/ironruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:632:in `execute'
C:/IronRuby/lib/ironruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
C:/TeamCity/buildAgent/plugins/rake-runner/lib/rb/runner/rake_ext.rb:260:in `execute'
:0:in `call'
C:/TeamCity/buildAgent/plugins/rake-runner/lib/rb/runner/rake_ext.rb:90:in `target_exception_handling'
C:/TeamCity/buildAgent/plugins/rake-runner/lib/rb/runner/rake_ext.rb:263:in `execute'
:0:in `each'
C:/IronRuby/lib/ironruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain'
C:/IronRuby/lib/ruby/1.8/monitor.rb:242:in `mon_synchronize'
C:/IronRuby/lib/ironruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
C:/IronRuby/lib/ironruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:607:in `invoke_prerequisites'
C:/IronRuby/lib/ironruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `invoke_prerequisites'
C:/IronRuby/lib/ironruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:596:in `invoke_with_call_chain'
C:/IronRuby/lib/ruby/1.8/monitor.rb:242:in `mon_synchronize'
C:/IronRuby/lib/ironruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
C:/IronRuby/lib/ironruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
C:/TeamCity/buildAgent/plugins/rake-runner/lib/rb/runner/rake_ext.rb:235:in `my_invoke_with_call_chain'
C:/TeamCity/buildAgent/plugins/rake-runner/lib/rb/runner/rake_ext.rb:90:in `target_exception_handling'
C:/TeamCity/buildAgent/plugins/rake-runner/lib/rb/runner/rake_ext.rb:234:in `my_invoke_with_call_chain'
:0:in `each'
C:/IronRuby/lib/ironruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
C:/IronRuby/lib/ironruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
C:/IronRuby/lib/ironruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2024:in `top_level'
C:/TeamCity/buildAgent/plugins/rake-runner/lib/rb/runner/rake_ext.rb:311:in `standard_exception_handling'
C:/IronRuby/lib/ironruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
C:/IronRuby/lib/ironruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
C:/TeamCity/buildAgent/plugins/rake-runner/lib/rb/runner/rake_ext.rb:311:in `standard_exception_handling'
C:/IronRuby/lib/ironruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
C:/TeamCity/buildAgent/plugins/rake-runner/lib/rb/runner/rake_ext.rb:179:in `run'
C:/TeamCity/buildAgent/plugins/rake-runner/lib/rb/runner/rakerunner.rb:40
:0:in `each'
[01:20:55]:
Rake aborted!
Please sign in to leave a comment.
Hello Michael,
Does rest part of build log contains any errors? Also could you try to run your spec rake tasks manually(on agent) from command line using IronRuby. Does it work without errors?
Update: It looks like spec.bat is broken under IronRuby. It can handle --require "path/to/file" with double-quotes, but not --require 'path/to/file' with single quotes.
I added this line to try to fix it in the meantime:
Which at leasts runs the specs and shows me how many pass, but it always fails:
This is apparently because IronRuby's IO class doesn't have a 'reopen' method.
Attachment(s):
ir_log.txt
ruby_ir.diff
rubyfail.txt
irfail.txt
I've come up with a tentative solution, which I'll post here for the good of future generations.
1.)
Because 'spec' under IronRuby can handle double double-quotes but not single-quotes, you need to put this at the top of your rakefile:
2.)
Because the current version of IronRuby (0.6) doesn't have IO#reopen, you need to at least define an empty method for it. Commit this file (which I call reopen_hack.rb) to a place that 'spec' can see. I just threw it in the root, but another place is probably better for organization's sake.
3.)
Require this file in your SPEC_OPTS, in your Build Configuration, under Runner: Rake -> Test Parameters
4.)
Add C:\TeamCity\buildAgent\plugins\rake-runner\lib\rb\patch to your RUBYLIB environment variable.
This should give you everything you need to use IronRuby with TeamCity for the time being, at least until a real solution comes along.
Michael,
Thank you for the workaround.
I'll take a look on Rake runner sources, in Teamcity 4.5.4 we doesn't need to reopen IO.
This isn't required because Rake-runner plugin for TeamCity patches RUBYLIB before running rake script.