Project

General

Profile

Actions

Refactor #16220

closed

Replace skip_callback in factories with stubbing

Added by Dominic Cleal over 7 years ago. Updated over 5 years ago.

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

Description

Compute resource factories currently call skip_callback on compute resources classes when constructing instances to disable contact with the CR, key generation, e.g.

after(:build) { |host| host.class.skip_callback(:create, :after, :setup_key_pair) }

On Rails 5.0, calling skip_callback for a non-existent callback now raises an error by default, so when this is called twice on the same class, it will fail the second time as the callback's been deleted.

To prevent modifying the class itself, the methods should be stubbed like other factories so that the callbacks are run, but have no effect.

Actions #1

Updated by The Foreman Bot over 7 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/3757 added
Actions #2

Updated by Dominic Cleal over 7 years ago

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

Updated by Dominic Cleal over 7 years ago

  • translation missing: en.field_release set to 160
Actions

Also available in: Atom PDF