mirror of
https://github.com/inventree/InvenTree.git
synced 2026-03-21 19:54:40 +00:00
[db] Backend setting improvements (#11500)
* Refactor database engine options - Move to setting/db_backend.py - Cleanup settings.py * Fix documentation for postgres settings * docs updates * Add transaction_mode options for sqlite * Update CHANGELOG with breaking changes * Remove hard-coded database config * Raise error on invalid backend * Fix typos * Fix broken redis link * Limit to single worker thread for sqlite * Update docs * Add verbosity switch to dev.test task * Add test timeout - kill hanging tests after 120s * Set WAL mode for sqlite * Use IMMEDIATE mode for background worker thread * Use config to set WAL rather than custom hook * Tweak pyproject settings * Tweak code * Increase timeouts * Reset requirements to master
This commit is contained in:
22
tasks.py
22
tasks.py
@@ -1350,19 +1350,21 @@ def test_translations(c):
|
||||
'translations': 'Compile translations before running tests',
|
||||
'keepdb': 'Keep the test database after running tests (default = False)',
|
||||
'pytest': 'Use pytest to run tests',
|
||||
'verbosity': 'Verbosity level for test output (default = 1)',
|
||||
}
|
||||
)
|
||||
def test(
|
||||
c,
|
||||
check=False,
|
||||
disable_pty=False,
|
||||
runtest='',
|
||||
migrations=False,
|
||||
report=False,
|
||||
coverage=False,
|
||||
translations=False,
|
||||
keepdb=False,
|
||||
pytest=False,
|
||||
check: bool = False,
|
||||
disable_pty: bool = False,
|
||||
runtest: str = '',
|
||||
migrations: bool = False,
|
||||
report: bool = False,
|
||||
coverage: bool = False,
|
||||
translations: bool = False,
|
||||
keepdb: bool = False,
|
||||
pytest: bool = False,
|
||||
verbosity: int = 1,
|
||||
):
|
||||
"""Run unit-tests for InvenTree codebase.
|
||||
|
||||
@@ -1410,6 +1412,8 @@ def test(
|
||||
|
||||
cmd += ' --exclude-tag performance_test'
|
||||
|
||||
cmd += f' --verbosity {verbosity}'
|
||||
|
||||
if coverage:
|
||||
# Run tests within coverage environment, and generate report
|
||||
run(c, f'coverage run {manage_py_path()} {cmd}')
|
||||
|
||||
Reference in New Issue
Block a user