tests: adapt to changes in wcs runscript command (#42098)

This commit is contained in:
Frédéric Péters 2019-06-30 14:04:39 +02:00 committed by Benjamin Dauvergne
parent 799d799565
commit f3ed695059
3 changed files with 7 additions and 6 deletions

View File

@ -184,10 +184,10 @@ ALLOWED_HOSTS = ['%s']
# launch a Django worker for running w.c.s.
WCS_PID = os.fork()
if not WCS_PID:
os.chdir(os.path.dirname(utils.WCSCTL))
os.chdir(os.path.dirname(utils.WCS_MANAGE))
os.environ['DJANGO_SETTINGS_MODULE'] = 'wcs.settings'
os.environ['WCS_SETTINGS_FILE'] = str(wcs_dir / 'local_settings.py')
os.execvp('python', ['python', 'manage.py', 'runserver', '--noreload', '%s:%s' % (ADDRESS, PORT)])
os.execvp('python', [sys.executable, 'manage.py', 'runserver', '--noreload', '%s:%s' % (ADDRESS, PORT)])
sys.exit(0)
# verify w.c.s. is launched

View File

@ -1,9 +1,10 @@
import os
import subprocess
import sys
HOSTNAME = '127.0.0.1'
WCSCTL = os.environ.get('WCSCTL')
WCS_MANAGE = os.environ.get('WCS_MANAGE')
def run_wcs_script(wcs_dir, script, script_name):
@ -13,5 +14,5 @@ def run_wcs_script(wcs_dir, script, script_name):
fd.write(script)
subprocess.check_call(
[WCSCTL, 'runscript', '--app-dir', str(wcs_dir), '--vhost', HOSTNAME,
str(script_path)])
[sys.executable, WCS_MANAGE, 'runscript', '--app-dir', str(wcs_dir), '--vhost', HOSTNAME, str(script_path)],
env={'DJANGO_SETTINGS_MODULE': 'wcs.settings'})

View File

@ -11,7 +11,7 @@ envlist = py3-coverage
usedevelop = true
setenv =
coverage: COVERAGE=--junit-xml=junit.xml --cov=wcs_olap --cov-report xml --cov-report html
WCSCTL=wcs/wcsctl.py
WCS_MANAGE=wcs/manage.py
deps =
coverage
pytest