Bug #14097
Only run DatabaseCleaner as 'truncation' on JS tests
Description
Problem:
DatabaseCleaner runs after all integration tests, on truncation mode. However, for tests where we use rack-test instead of poltergeist, this is not necessary and slows down the test suite.
Solution:
Mark the tests that use javascript and only run DatabaseCleaner on truncation mode on these, the rest of them can run in transaction mode (faster).
Related issues
Associated revisions
History
#1
Updated by The Foreman Bot about 6 years ago
- Status changed from New to Ready For Testing
- Assignee set to Daniel Lobato Garcia
- Pull request https://github.com/theforeman/foreman/pull/3293 added
#2
Updated by Daniel Lobato Garcia about 6 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset 26dade0f18bba02430bec08283a47ba039173f37.
#3
Updated by Dominic Cleal about 6 years ago
- Legacy Backlogs Release (now unused) set to 136
#4
Updated by Dominic Cleal about 6 years ago
- Related to Bug #14228: running single test fails due to FileUtils not being required added
#5
Updated by Stephen Benjamin about 6 years ago
- Related to Bug #14273: Salt integration tets are failing added
#6
Updated by Dominic Cleal about 6 years ago
- Related to Bug #9138: Intermittent HostTest/NIC integration test failures added
Fixes #14097 - Only run DatabaseCleaner truncation on JS tests
Problem:
DatabaseCleaner runs after all integration tests, on truncation mode.
However, for tests where we use rack-test instead of poltergeist, this
is not necessary and slows down the test suite.
Solution:
Mark the tests that use javascript and only run DatabaseCleaner on
truncation mode on these, the rest of them can run in transaction mode
(faster).
Some basic benchmarking of rake test:integration suggests this is 15% faster
than before this patch (before, 3m 42s avg, now 3m 09s avg).
Additionally this patch allows login to happen only once for integration
tests that require JS (it logged in twice before), and loads fewer
dependencies for integration tests when ran on isolation (rake test:integration)