Refactor #19463

Disable audit creation in factory_girl-created models in tests

Added by Dominic Cleal about 1 year ago. Updated 7 days ago.

Status:Closed
Priority:Low
Assignee:Dominic Cleal
Category:Tests
Target version:1.16.0
Difficulty: Team Backlog:
Triaged: Fixed in Releases:
Bugzilla link: Found in Releases:
Pull request:https://github.com/theforeman/foreman/pull/4504

Description

factory_girl creates models in tests with a regular save! call, which results in audit entries being created for every factory-based fixture. Disabling auditing while creating these would save on writes to the database in the test environment, as they're pretty much entirely unused.

The few tests that do rely on factory_girl objects having corresponding audit entries can have them manually enabled (opt-in).


Related issues

Related to Foreman Remote Execution - Bug #19525: Tests are failling with foreman 1.16 develop on job invoc... Closed 05/12/2017

Associated revisions

Revision ec9c2bcf
Added by Dominic Cleal about 1 year ago

fixes #19463 - disable auditing of factory_girl fixtures

Audit entries are mostly superfluous in the test environment, but can
be enabled by adding the :with_auditing trait. Disabling audits
improves the test:models runtime from 160 to 128 seconds for me.

History

#1 Updated by The Foreman Bot about 1 year ago

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

#2 Updated by Dominic Cleal about 1 year ago

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

#3 Updated by Ivan Necas about 1 year ago

  • Related to Bug #19525: Tests are failling with foreman 1.16 develop on job invocatoin composer added

#4 Updated by Marek Hulán 9 months ago

  • Legacy Backlogs Release (now unused) set to 240

Also available in: Atom PDF