Unit test fixes (#10019)

* Add --keepdb option for unit test

* Reduce server launch overhead

- isGeneratingSchema was EXPENSIVE
- Running a single unit test reduced from 30s to 3s

* Option to disable check
This commit is contained in:
Oliver authored and GitHub committed 2025-07-15 01:30:58 +10:00
1 parent ea00a50dfd
commit d62ac38cb1
5 files changed
+23 -17

No files matched your search

+6
View File
@@ -47,6 +47,12 @@ def isRunningBackup():
def isGeneratingSchema():
"""Return true if schema generation is being executed."""
if isInServerThread() or isInWorkerThread():
return False
if isInTestMode():
return False
if 'schema' in sys.argv:
return True
+1 -1
View File
@@ -814,7 +814,7 @@ inventree_tags = {
}
# sentry.io integration for error reporting
SENTRY_ENABLED = get_boolean_setting(
SENTRY_ENABLED = not TESTING and get_boolean_setting(
'INVENTREE_SENTRY_ENABLED', 'sentry_enabled', False
)