Refactor #19463

Disable audit creation in factory_girl-created models in tests

Added by Dominic Cleal 12 months ago. Updated 6 months ago.

Status:Closed
Priority:Low
Assigned To:Dominic Cleal
Category:Tests
Target version:-
Difficulty: Bugzilla link:
Found in release: Pull request:https://github.com/theforeman/foreman/pull/4504
Story points-
Velocity based estimate-
Release1.16.0Release relationshipAuto

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 12 months 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 12 months ago

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

#2 Updated by Dominic Cleal 12 months ago

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

#3 Updated by Ivan Necas 12 months ago

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

#4 Updated by Marek Hulán 6 months ago

  • Release set to 1.16.0

Also available in: Atom PDF