2
0
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:
Oliver
2026-03-18 00:01:17 +11:00
committed by GitHub
parent 34b7a559d7
commit 756c0be0b5
13 changed files with 220 additions and 124 deletions

View File

@@ -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}')