2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-17 20:45:44 +00:00

[CI] Playwright improvements (#9395)

* Allow port 4173 (vite preview)

* Change 'base' attr based on vite command

* Allow api_host to be specified separately

* Harden API host functionality

* Adjust server selections

* Cleanup vite.config.ts

* Adjust playwright configuration

- Allow to run in "production" mode
- Builds the code first
- Runs only the backend web server
- Not suitable for coverage

* Tweak github actions

* Tweak QC file

* Reduce number of steps

* Tweak CI file

* Fix typo

* Ensure translation before build

* Fix hard-coded test

* Test tweaks

* uncomment

* Revert some changes

* Run with gunicorn, single worker

* Reduce log output in DEBUG mode

* Update deps

* Add global-setup func

* Fix for .gitignore file

* Cached auth state

* Tweak login func

* Updated tests

* Enable parallel workers again

* Simplify config

* Try with a single worker again

* Single retry mode

* Run auth setup first

- Prevent issues with parallel test doing login

* Improve test setup process

* Tweaks

* Bump to 3 workers

* Tweak playwright settings

* Revert change

* Revert change
This commit is contained in:
Oliver
2025-03-30 14:12:48 +11:00
committed by GitHub
parent 858eb8f807
commit 7f5a447769
40 changed files with 794 additions and 575 deletions

View File

@ -406,13 +406,22 @@ def get_frontend_settings(debug=True):
'INVENTREE_FRONTEND_SETTINGS', 'frontend_settings', {}, typecast=dict
)
# Set the base URL
# Set the base URL for the user interface
# This is the UI path e.g. '/web/'
if 'base_url' not in frontend_settings:
frontend_settings['base_url'] = (
get_setting('INVENTREE_FRONTEND_URL_BASE', 'frontend_url_base', 'web')
or 'web'
)
# If provided, specify the API host
api_host = frontend_settings.get('api_host', None) or get_setting(
'INVENTREE_FRONTEND_API_HOST', 'frontend_api_host', None
)
if api_host:
frontend_settings['api_host'] = api_host
# Set the server list
frontend_settings['server_list'] = frontend_settings.get('server_list', [])

View File

@ -1088,6 +1088,7 @@ if DEBUG:
'http://localhost',
'http://*.localhost',
'http://*localhost:8000',
'http://*localhost:4173',
'http://*localhost:5173',
]:
if origin not in CSRF_TRUSTED_ORIGINS:

View File

@ -2,6 +2,7 @@
from datetime import timedelta
from django.conf import settings
from django.utils import timezone
import structlog
@ -60,13 +61,16 @@ def check_system_health(**kwargs):
if not is_worker_running(**kwargs): # pragma: no cover
result = False
logger.warning('Background worker check failed')
if not settings.DEBUG:
logger.warning('Background worker check failed')
if not InvenTree.helpers_email.is_email_configured(): # pragma: no cover
result = False
logger.warning('Email backend not configured')
if not settings.DEBUG:
logger.warning('Email backend not configured')
if not result: # pragma: no cover
logger.warning('InvenTree system health checks failed')
if not settings.DEBUG:
logger.warning('InvenTree system health checks failed')
return result