Project

General

Profile

Bug #6962

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

Added by Greg Sutcliffe over 4 years ago. Updated 9 months ago.

Status:
Closed
Priority:
Normal
Category:
Tests
Target version:
Difficulty:
trivial
Triaged:
Bugzilla link:
Team Backlog:
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.

Associated revisions

Revision 28fd090c (diff)
Added by Greg Sutcliffe over 4 years ago

Fixes #6962 - Use as_admin instead of find_by_login for usergroup tests

History

#1 Updated by Greg Sutcliffe over 4 years ago

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

#2 Updated by The Foreman Bot over 4 years ago

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

#3 Updated by Dominic Cleal over 4 years ago

  • Category changed from Katello integration to Tests

#4 Updated by Greg Sutcliffe over 4 years ago

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

Also available in: Atom PDF