Project

General

Profile

Refactor #19463

Disable audit creation in factory_girl-created models in tests

Added by Dominic Cleal over 1 year ago. Updated 4 months ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
Tests
Target version:
Difficulty:
Triaged:
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:

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 invocatoin composerClosed2017-05-12

Associated revisions

Revision ec9c2bcf (diff)
Added by Dominic Cleal over 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 over 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 over 1 year ago

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

#3 Updated by Ivan Necas over 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 about 1 year ago

  • Legacy Backlogs Release (now unused) set to 240

Also available in: Atom PDF