[katello-devel] headpin test into travis

Lukas Zapletal lzap at redhat.com
Wed Feb 27 12:36:47 UTC 2013


Hey Adam,

the thing is you have turned off katello mode. And if you look into
bundler.d/foreman.rb you can see that this group is only included if
running in Katello mode.

In production, we do not distribute some files, in this case its
app/models/foreman/* so in production there is not an issue. As Petr
told me, in the testing environment, Rails is configured to eager load
all the classes. That is the reason for the error you see.

If you want to execute headpin unit tests separately, you need to solve
this first. But what is the point of running unit tests twice - once for
katello (including all headpin tests) and once for headpin only? I mean
if katello tests are all green, headpin are all green too, except some
misconfiguration (file is missing or something like that).

Our unit tests depends on configuration, database and this is not good.
We should maybe solve this and then there wouldnt be any need for
running headpin tests separately.

LZ

On Tue, Feb 26, 2013 at 01:28:28PM -0500, Adam Price wrote:
> hello all,
> 
> can one of the more knowledgable ruby/foreman folks take a look at / fix this? There's all this magic loading going on that I can't follow. I'm working on getting the headpin rspec tests into travis to run along-side the katello rspec tests, and minitest.
> 
> here's the branch i'm working off of:
> https://github.com/Katello/katello/pull/1636
> 
> here's the travis build with the stacktrace:
> https://travis-ci.org/komidore64/katello/builds/5073343
> 
> 
> [ travis output ]
> 
> [ ... ]
> /home/travis/build/komidore64/katello/src/lib/resources/foreman.rb:28: uninitialized constant Resources::Foreman::ForemanApi (NameError)
> 	from /home/travis/build/komidore64/katello/src/app/models/foreman/compute_resource/ec2.rb:19
> 	from /home/travis/.rvm/gems/ruby-1.8.7-p371/gems/railties-3.0.10/lib/rails/engine.rb:138:in `eager_load!'
> 	from /home/travis/.rvm/gems/ruby-1.8.7-p371/gems/railties-3.0.10/lib/rails/engine.rb:137:in `each'
> 	from /home/travis/.rvm/gems/ruby-1.8.7-p371/gems/railties-3.0.10/lib/rails/engine.rb:137:in `eager_load!'
> 	from /home/travis/.rvm/gems/ruby-1.8.7-p371/gems/railties-3.0.10/lib/rails/engine.rb:135:in `each'
> 	from /home/travis/.rvm/gems/ruby-1.8.7-p371/gems/railties-3.0.10/lib/rails/engine.rb:135:in `eager_load!'
> 	from /home/travis/.rvm/gems/ruby-1.8.7-p371/gems/railties-3.0.10/lib/rails/application.rb:108:in `eager_load!'
> 	from /home/travis/.rvm/gems/ruby-1.8.7-p371/gems/railties-3.0.10/lib/rails/application/finisher.rb:41
> 	from /home/travis/.rvm/gems/ruby-1.8.7-p371/gems/railties-3.0.10/lib/rails/initializable.rb:25:in `instance_exec'
> 	from /home/travis/.rvm/gems/ruby-1.8.7-p371/gems/railties-3.0.10/lib/rails/initializable.rb:25:in `run'
> 	from /home/travis/.rvm/gems/ruby-1.8.7-p371/gems/railties-3.0.10/lib/rails/initializable.rb:50:in `run_initializers'
> 	from /home/travis/.rvm/gems/ruby-1.8.7-p371/gems/railties-3.0.10/lib/rails/initializable.rb:49:in `each'
> 	from /home/travis/.rvm/gems/ruby-1.8.7-p371/gems/railties-3.0.10/lib/rails/initializable.rb:49:in `run_initializers'
> 	from /home/travis/.rvm/gems/ruby-1.8.7-p371/gems/railties-3.0.10/lib/rails/application.rb:134:in `initialize!'
> 	from /home/travis/.rvm/gems/ruby-1.8.7-p371/gems/railties-3.0.10/lib/rails/application.rb:77:in `send'
> 	from /home/travis/.rvm/gems/ruby-1.8.7-p371/gems/railties-3.0.10/lib/rails/application.rb:77:in `method_missing'
> 	from /home/travis/build/komidore64/katello/src/config/environment.rb:5
> 	from /home/travis/build/komidore64/katello/src/spec/spec_helper.rb:17:in `require'
> 	from /home/travis/build/komidore64/katello/src/spec/spec_helper.rb:17
> 	from /home/travis/build/komidore64/katello/src/spec/controllers/api/activation_keys_controller_spec.rb:13:in `require'
> 	from /home/travis/build/komidore64/katello/src/spec/controllers/api/activation_keys_controller_spec.rb:13
> 	from /home/travis/.rvm/gems/ruby-1.8.7-p371/gems/rspec-core-2.13.0/lib/rspec/core/configuration.rb:819:in `load'
> 	from /home/travis/.rvm/gems/ruby-1.8.7-p371/gems/rspec-core-2.13.0/lib/rspec/core/configuration.rb:819:in `load_spec_files'
> 	from /home/travis/.rvm/gems/ruby-1.8.7-p371/gems/rspec-core-2.13.0/lib/rspec/core/configuration.rb:819:in `each'
> 	from /home/travis/.rvm/gems/ruby-1.8.7-p371/gems/rspec-core-2.13.0/lib/rspec/core/configuration.rb:819:in `load_spec_files'
> 	from /home/travis/.rvm/gems/ruby-1.8.7-p371/gems/rspec-core-2.13.0/lib/rspec/core/command_line.rb:22:in `run'
> 	from /home/travis/.rvm/gems/ruby-1.8.7-p371/gems/rspec-core-2.13.0/lib/rspec/core/runner.rb:80:in `run'
> 	from /home/travis/.rvm/gems/ruby-1.8.7-p371/gems/rspec-core-2.13.0/lib/rspec/core/runner.rb:17:in `autorun'
> 	from /home/travis/.rvm/gems/ruby-1.8.7-p371/bin/rspec:23
> [warn]: Error loading plugin 'yard-activerecord'
> 
> 
> 
> Took 10.498906 seconds
> Tests Failed
> 
> [ end travis output ]
> 
> 
> Thank you for your help
> 
> -- 
> Adam Price
> Software Engineer
> Red Hat Inc., Raleigh
> 
> adprice at redhat dot com
> http://github.com/komidore64
> http://www.ohloh.net/accounts/komidore64
> 
> _______________________________________________
> katello-devel mailing list
> katello-devel at redhat.com
> https://www.redhat.com/mailman/listinfo/katello-devel

-- 
Later,

 Lukas "lzap" Zapletal
 #katello #systemengine




More information about the katello-devel mailing list