Bug #6620

Allow plugins to include test setup code in the test_helper

Added by Eric Helms almost 4 years ago. Updated over 3 years ago.

Status:Closed
Priority:Normal
Assigned To:Eric Helms
Category:Tests
Target version:Sprint 27
Difficulty: Bugzilla link:
Found in release: Pull request:https://github.com/theforeman/foreman/pull/1587
Story points-
Velocity based estimate-
Release1.6.0Release relationshipAuto

Associated revisions

Revision 80a2f885
Added by Eric Helms over 3 years ago

Fixes #6620: Allow plugins to define a file to be included in test_helper.

For some plugins additions to the test_helper are needed to allow
the test suite to pass. This checks if a file test/support/foreman_support
exists and requires it after all the Foreman test setup is done.

History

#1 Updated by The Foreman Bot almost 4 years ago

  • Status changed from New to Ready For Testing
  • Target version set to Sprint 26
  • Pull request https://github.com/theforeman/foreman/pull/1587 added

#2 Updated by Dmitri Dolguikh over 3 years ago

  • Target version changed from Sprint 26 to Sprint 27

#3 Updated by Eric Helms over 3 years ago

In some cases, a plugin may modifies or changes core Foreman behaviors such that for the Foreman tests to run in the context of the plugin some setup code may need to be run before the test suites. In Katello currently, if the Foreman unit tests are run there are a number of errors thrown about "running a dynflow action in a transaction" which can be squelched by including the following in the test helper via this functionality:

Organization.class_eval do
def ensure_not_in_transaction!
end

def execute_planned_action
end
end

User.class_eval do
def ensure_not_in_transaction!
end

def execute_planned_action
end
end

#4 Updated by Dominic Cleal over 3 years ago

  • Release set to 1.6.0

#5 Updated by Eric Helms over 3 years ago

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

Also available in: Atom PDF