TeamCity runner fails, though manually I can make it work

I have installed TeamCity and have run into a problem.  Basically what I've done is to create a simple scenario.  I forked one of Wolfram Arnold's teaching apps to my own repository, then manually did the following:

$ git clone git@github.com:purplejacket/Efficient-Test-Driven-Rails-Development.git
$ cd Efficient-Test-Driven-Rails-Development
$ rake db:migrate
$ rake spec

93 examples, 0 failures

However, when I try to set this up to run through TeamCity, I get the following:

Build errors

[14:03:11]: Execute spec (2s)
[14:03:13]: [Execute spec]
RuntimeError: Command /home/kai/.rvm/rubies/ruby-1.8.7-p302/bin/ruby -I"lib"  "/home/kai/.rvm/gems/ruby-1.8.7-p302/gems/rspec-1.3.0/bin/spec" "spec/controllers/people_controller_spec.rb" "spec/models/order_spec.rb" "spec/models/customer_spec.rb" "spec/models/message_spec.rb" "spec/models/order_item_spec.rb" "spec/models/user_spec.rb" "spec/models/address_spec.rb" "spec/models/item_spec.rb" "spec/models/person_spec.rb" "spec/lib/mock_spec.rb" "spec/lib/array_commutation_spec.rb" "spec/routing/people_controller_routing_spec.rb" "spec/views/people/_person_form.html.erb_spec.rb" --require 'teamcity/spec/runner/formatter/teamcity/formatter' --format Spec::Runner::Formatter::TeamcityFormatter:matrix failed


Stacktrace:
/home/kai/.rvm/gems/ruby-1.8.7-p302/gems/rspec-1.3.0/lib/spec/rake/spectask.rb:177:in `define'
/home/kai/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.8.7/lib/rake.rb:1112:in `verbose'
/home/kai/.rvm/gems/ruby-1.8.7-p302/gems/rspec-1.3.0/lib/spec/rake/spectask.rb:153:in `define'
/home/kai/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/home/kai/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.8.7/lib/rake.rb:636:in `standard_execute'
/home/kai/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/home/kai/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.8.7/lib/rake.rb:631:in `standard_execute'
/home/kai/TeamCity/buildAgent/plugins/rake-runner/lib/rb/runner/rake_ext.rb:260:in `execute'
/home/kai/TeamCity/buildAgent/plugins/rake-runner/lib/rb/runner/rake_ext.rb:90:in `target_exception_handling'
/home/kai/TeamCity/buildAgent/plugins/rake-runner/lib/rb/runner/rake_ext.rb:266:in `execute'
/home/kai/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain'
/home/kai/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/home/kai/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/home/kai/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.8.7/lib/rake.rb:583:in `standard_invoke_with_call_chain'
/home/kai/TeamCity/buildAgent/plugins/rake-runner/lib/rb/runner/rake_ext.rb:235:in `invoke'
/home/kai/TeamCity/buildAgent/plugins/rake-runner/lib/rb/runner/rake_ext.rb:90:in `target_exception_handling'
/home/kai/TeamCity/buildAgent/plugins/rake-runner/lib/rb/runner/rake_ext.rb:234:in `invoke'
/home/kai/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
/home/kai/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/home/kai/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/home/kai/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/home/kai/TeamCity/buildAgent/plugins/rake-runner/lib/rb/runner/rake_ext.rb:311:in `standard_exception_handling'
/home/kai/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
/home/kai/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
/home/kai/TeamCity/buildAgent/plugins/rake-runner/lib/rb/runner/rake_ext.rb:311:in `standard_exception_handling'
/home/kai/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/home/kai/TeamCity/buildAgent/plugins/rake-runner/lib/rb/runner/rake_ext.rb:179:in `run'
/home/kai/TeamCity/buildAgent/plugins/rake-runner/lib/rb/runner/rakerunner.rb:40
[14:03:13]:
Rake aborted!



Furthermore, I have found what looks like the directory that the TeamCity agent is using:

$ cd /home/kai/TeamCity/buildAgent/work/c58c28c318d24ad3

Then I do the original experiment and everything works:

$ rake db:migrate
$ rake spec
93 examples, 0 failures


So I don't know what problem TeamCity is having.

Thanks for any help.

Kai Middleton
4 comments

I found a solution/workaround:

gem uninstall test-unit

I am not satisfied with that solution though.  Why should I have to uninstall test-unit just to make TeamCity happy?

I found the answer by clicking into the "Build Log" tab (not just looking at the stack trace in the "Overview" tab.  It showed me this:

[16:13:54]: Execute spec (2s)
[16:13:56]: [Execute spec] /home/kai/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:105:in `const_missing': uninitialized constant Test::Unit::TestResult::TestResultFailureSupport (NameError)
[16:13:56]: [Execute spec] from /home/kai/.rvm/gems/ruby-1.8.7-p302/gems/test-unit-2.1.1/lib/test/unit/testresult.rb:28
[16:13:56]: [Execute spec] from /home/kai/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
[16:13:56]: [Execute spec] from /home/kai/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
[16:13:56]: [Execute spec] from /home/kai/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:158:in `require'
[16:13:56]: [Execute spec] from /home/kai/.rvm/gems/ruby-1.8.7-p302/gems/rspec-1.3.0/lib/spec/interop/test.rb:34
[16:13:56]: [Execute spec] from /home/kai/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
[16:13:56]: [Execute spec] from /home/kai/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
[16:13:56]: [Execute spec] RuntimeError: Command /home/kai/.rvm/rubies/ruby-1.8.7-p302/bin/ruby -I"lib"  "/home/kai/.rvm/gems/ruby-1.8.7-p302/gems/rspec-1.3.0/bin/spec" "spec/controllers/people_controller_spec.rb" "spec/models/order_spec.rb" "spec/models/customer_spec.rb" "spec/models/message_spec.rb" "spec/models/order_item_spec.rb" "spec/models/user_spec.rb" "spec/models/address_spec.rb" "spec/models/item_spec.rb" "spec/models/person_spec.rb" "spec/lib/mock_spec.rb" "spec/lib/array_commutation_spec.rb" "spec/routing/people_controller_routing_spec.rb" "spec/views/people/_person_form.html.erb_spec.rb" --options "/home/kai/TeamCity/buildAgent/work/c58c28c318d24ad3/spec/spec.opts" failed  Stacktrace: /home/kai/.rvm/gems/ruby-1.8.7-p302/gems/rspec-1.3.0/lib/spec/rake/spectask.rb:177:in `define' /home/kai/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.8.7/lib/rake.rb:1112:in `verbose' /home/kai/.rvm/gems/ruby-1.8.7-p302/gems/rspec-1.3.0/lib/spec/rake/spectask.rb:153:in `define' /home/kai/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.8.7/lib/rake.rb:636:in `call' /home/kai/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.8.7/lib/rake.rb:636:in `standard_execute' /home/kai/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.8.7/lib/rake.rb:631:in `each' /home/kai/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.8.7/lib/rake.rb:631:in `standard_execute' /home/kai/TeamCity/buildAgent/plugins/rake-runner/lib/rb/runner/rake_ext.rb:260:in `execute' /home/kai/TeamCity/buildAgent/plugins/rake-runner/lib/rb/runner/rake_ext.rb:90:in `target_exception_handling' /home/kai/TeamCity/buildAgent/plugins/rake-runner/lib/rb/runner/rake_ext.rb:266:in `execute' /home/kai/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain' /home/kai/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/monitor.rb:242:in `synchronize' /home/kai/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain' /home/kai/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.8.7/lib/rake.rb:583:in `standard_invoke_with_call_chain' /home/kai/TeamCity/buildAgent/plugins/rake-runner/lib/rb/runner/rake_ext.rb:235:in `invoke' /home/kai/TeamCity/buildAgent/plugins/rake-runner/lib/rb/runner/rake_ext.rb:90:in `target_exception_handling' /home/kai/TeamCity/buildAgent/plugins/rake-runner/lib/rb/runner/rake_ext.rb:234:in `invoke' /home/kai/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task' /home/kai/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level' /home/kai/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.8.7/lib/rake.rb:2029:in `each' /home/kai/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level' /home/kai/TeamCity/buildAgent/plugins/rake-runner/lib/rb/runner/rake_ext.rb:311:in `standard_exception_handling' /home/kai/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level' /home/kai/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.8.7/lib/rake.rb:2001:in `run' /home/kai/TeamCity/buildAgent/plugins/rake-runner/lib/rb/runner/rake_ext.rb:311:in `standard_exception_handling' /home/kai/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.8.7/lib/rake.rb:1998:in `run' /home/kai/TeamCity/buildAgent/plugins/rake-runner/lib/rb/runner/rake_ext.rb:179:in `run' /home/kai/TeamCity/buildAgent/plugins/rake-runner/lib/rb/runner/rakerunner.rb:40
[16:13:56]: [Execute spec] from /home/kai/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:158:in `require'
[16:13:56]: [Execute spec] from /home/kai/.rvm/gems/ruby-1.8.7-p302/gems/rspec-1.3.0/lib/spec/test/unit.rb:1
[16:13:56]: from /home/kai/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
[16:13:56]: from /home/kai/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
[16:13:56]: Rake aborted!
[16:13:56]: from /home/kai/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:158:in `require'
[16:13:56]: from /home/kai/.rvm/gems/ruby-1.8.7-p302/gems/rspec-rails-1.3.2/lib/spec/rails.rb:13
[16:13:56]: from /home/kai/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
[16:13:56]: from /home/kai/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
[16:13:56]: from /home/kai/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:158:in `require'
[16:13:56]: from /home/kai/TeamCity/buildAgent/work/c58c28c318d24ad3/spec/spec_helper.rb:6
[16:13:56]: from ./spec/controllers/people_controller_spec.rb:1:in `require'
[16:13:56]: from ./spec/controllers/people_controller_spec.rb:1
[16:13:56]: from /home/kai/.rvm/gems/ruby-1.8.7-p302/gems/rspec-1.3.0/lib/spec/runner/example_group_runner.rb:15:in `load'
[16:13:56]: from /home/kai/.rvm/gems/ruby-1.8.7-p302/gems/rspec-1.3.0/lib/spec/runner/example_group_runner.rb:15:in `load_files'
[16:13:56]: from /home/kai/.rvm/gems/ruby-1.8.7-p302/gems/rspec-1.3.0/lib/spec/runner/example_group_runner.rb:14:in `each'
[16:13:56]: from /home/kai/.rvm/gems/ruby-1.8.7-p302/gems/rspec-1.3.0/lib/spec/runner/example_group_runner.rb:14:in `load_files'
[16:13:56]: from /home/kai/.rvm/gems/ruby-1.8.7-p302/gems/rspec-1.3.0/lib/spec/runner/options.rb:133:in `run_examples'
[16:13:56]: from /home/kai/.rvm/gems/ruby-1.8.7-p302/gems/rspec-1.3.0/lib/spec/runner/command_line.rb:9:in `run'
[16:13:56]: from /home/kai/.rvm/gems/ruby-1.8.7-p302/gems/rspec-1.3.0/bin/spec:5
[16:13:56]: Process exited with code 1
[16:13:56]: Build finished


So I googled on uninitialized constant Test::Unit::TestResult::TestResultFailureSupport (NameError)
That lead me to this page:
http://stackoverflow.com/questions/1145318/getting-uninitialized-constant-error-when-trying-to-run-tests 

The discussions on that page suggested removing test-unit, and that allowed the build to go through.
0

Hello Kai,

Which TeamCity version do you use?

0

The most recent: TeamCity-5.1.4.tar.gz

And FYI I've attached the full log of the error that I was getting before I uninstalled the test-unit gem.



Attachment(s):
editorlive_Master_3.log.zip
0

Kai,

Sorry for taking so long to reply, we are investigating your issue.

0

Please sign in to leave a comment.