Project

General

Profile

Actions

Bug #6962

closed

Load usergroup admin user from fixtures directly to avoid a katello issue in tests

Added by Greg Sutcliffe over 10 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Category:
Tests
Target version:
Difficulty:
trivial
Triaged:
Fixed in Releases:
Found in Releases:

Description

Currently when running the foreman core tests with katello enabled, the UsergroupMemberTests fail with this:

undefined method `remote_id' for nil:NilClass (NoMethodError)
/var/lib/workspace/workspace/test_katello_core_gsutcliffe/database/postgresql/ruby/1.9.3/plugin/app/lib/actions/middleware/remote_action.rb:21:in `block in plan'
/var/lib/workspace/workspace/test_katello_core_gsutcliffe/database/postgresql/ruby/1.9.3/plugin/app/lib/actions/middleware/remote_action.rb:21:in `tap'
/var/lib/workspace/workspace/test_katello_core_gsutcliffe/database/postgresql/ruby/1.9.3/plugin/app/lib/actions/middleware/remote_action.rb:21:in `plan'
/usr/local/rvm/gems/ruby-1.9.3-p392@test_katello_core_gsutcliffe-3/gems/dynflow-0.7.2/lib/dynflow/middleware/stack.rb:22:in `call'
/usr/local/rvm/gems/ruby-1.9.3-p392@test_katello_core_gsutcliffe-3/gems/dynflow-0.7.2/lib/dynflow/middleware/stack.rb:26:in `pass'
/usr/local/rvm/gems/ruby-1.9.3-p392@test_katello_core_gsutcliffe-3/gems/dynflow-0.7.2/lib/dynflow/middleware.rb:16:in `pass'
/usr/local/rvm/gems/ruby-1.9.3-p392@test_katello_core_gsutcliffe-3/gems/dynflow-0.7.2/lib/dynflow/middleware.rb:29:in `plan'
/usr/local/rvm/gems/ruby-1.9.3-p392@test_katello_core_gsutcliffe-3/gems/dynflow-0.7.2/lib/dynflow/middleware/stack.rb:22:in `call'
/usr/local/rvm/gems/ruby-1.9.3-p392@test_katello_core_gsutcliffe-3/gems/dynflow-0.7.2/lib/dynflow/middleware/world.rb:30:in `execute'
...

It seems that changing the tests to use `users(:admin)` fixes the problem, and is a cleaner use of fixtures anyway.

Actions #1

Updated by Greg Sutcliffe over 10 years ago

As per Dominic's suggestion, I'm actually refactoring these tests to use =as_admin= where appropriate.

Actions #2

Updated by The Foreman Bot over 10 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/1657 added
  • Pull request deleted ()
Actions #3

Updated by Dominic Cleal over 10 years ago

  • Category changed from 47 to Tests
Actions #4

Updated by Greg Sutcliffe over 10 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF