Projet

Général

Profil

0001-tests-adapt-to-changes-in-wcs-runscript-command-3440.patch

Frédéric Péters, 30 juin 2019 14:05

Télécharger (2,22 ko)

Voir les différences:

Subject: [PATCH] tests: adapt to changes in wcs runscript command (#34405)

 tests/conftest.py | 4 ++--
 tests/utils.py    | 7 ++++---
 tox.ini           | 2 +-
 3 files changed, 7 insertions(+), 6 deletions(-)
tests/conftest.py
170 170
    # launch a Django worker for running w.c.s.
171 171
    WCS_PID = os.fork()
172 172
    if not WCS_PID:
173
        os.chdir(os.path.dirname(utils.WCSCTL))
173
        os.chdir(os.path.dirname(utils.WCS_MANAGE))
174 174
        os.environ['DJANGO_SETTINGS_MODULE'] = 'wcs.settings'
175 175
        os.environ['WCS_SETTINGS_FILE'] = str(wcs_dir / 'local_settings.py')
176
        os.execvp('python', ['python', 'manage.py', 'runserver', '--noreload', '%s:%s' % (ADDRESS, PORT)])
176
        os.execvp('python', [sys.executable, 'manage.py', 'runserver', '--noreload', '%s:%s' % (ADDRESS, PORT)])
177 177
        sys.exit(0)
178 178

  
179 179
    # verify w.c.s. is launched
tests/utils.py
1 1
import os
2 2
import subprocess
3
import sys
3 4

  
4 5

  
5 6
HOSTNAME = '127.0.0.1'
6
WCSCTL = os.environ.get('WCSCTL')
7
WCS_MANAGE = os.environ.get('WCS_MANAGE')
7 8

  
8 9

  
9 10
def run_wcs_script(wcs_dir, script, script_name):
......
13 14
        fd.write(script)
14 15

  
15 16
    subprocess.check_call(
16
        [WCSCTL, 'runscript', '--app-dir', str(wcs_dir), '--vhost', HOSTNAME,
17
         str(script_path)])
17
        [sys.executable, WCS_MANAGE, 'runscript', '--app-dir', str(wcs_dir), '--vhost', HOSTNAME, str(script_path)],
18
        env={'DJANGO_SETTINGS_MODULE': 'wcs.settings'})
tox.ini
12 12
basepython = python2
13 13
setenv =
14 14
	coverage: COVERAGE=--junit-xml=junit.xml --cov=wcs_olap --cov-report xml --cov-report html
15
	WCSCTL=wcs/wcsctl.py
15
	WCS_MANAGE=wcs/manage.py
16 16
deps =
17 17
	coverage
18 18
	pytest
19
-