File tree Expand file tree Collapse file tree 4 files changed +23
-12
lines changed Expand file tree Collapse file tree 4 files changed +23
-12
lines changed Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ set -ex
4+
5+ cd " $1 " ; shift
6+
7+ exec $@
Original file line number Diff line number Diff line change @@ -233,13 +233,13 @@ def startup_check(self):
233233 pass
234234 return False
235235
236+ terminate_on_interrupt = True
236237 pattern = f"server at http://{ host } :{ port } "
237238 args = [
238239 "bash" ,
239- "-ec" ,
240- f"cd { Path (__file__ ).parent / 'data' / 'django' } ;"
241- + f" { sys .executable } manage.py runserver"
242- + f" { host } :{ port } " ,
240+ Path (__file__ ).parent / "bin" / "runner" ,
241+ (Path (__file__ ).parent / "data" / "django" ).as_posix (),
242+ f"{ Path (sys .executable ).as_posix ()} manage.py runserver { host } :{ port } " ,
243243 ]
244244 env = {
245245 "DJANGO_SETTINGS_MODULE" : f"djangoapp.{ settings } " ,
Original file line number Diff line number Diff line change @@ -88,14 +88,16 @@ def startup_check(self):
8888 pass
8989 return False
9090
91+ timeout = 10
92+ terminate_on_interrupt = True
9193 pattern = f"Uvicorn running on http://{ host } :{ port } "
9294 # Can't set popen_kwargs["cwd"] until
9395 # https://github.com/pytest-dev/pytest-xprocess/issues/89 is fixed.
9496 args = [
9597 "bash" ,
96- "-ec " ,
97- f"cd { Path (__file__ ).parent / ' data' / ' fastapi' } ;"
98- + f" { sys .executable } -m uvicorn fastapiapp.main:app"
98+ Path ( __file__ ). parent / "bin" / "runner " ,
99+ ( Path (__file__ ).parent / " data" / " fastapi" ). as_posix (),
100+ f" { Path ( sys .executable ). as_posix () } -m uvicorn fastapiapp.main:app"
99101 + f" { reload } --host { host } --port { port } " ,
100102 ]
101103 env = {
Original file line number Diff line number Diff line change @@ -125,24 +125,26 @@ def startup_check(self):
125125 pass
126126 return False
127127
128+ terminate_on_interrupt = True
128129 pattern = f"Running on http://{ host } :{ port } "
129130 args = [
130131 "bash" ,
131- "-ec" ,
132- f"cd { Path (__file__ ).parent / 'data' / 'flask' } ;"
133- + f" { sys .executable } -m flask run"
134- + f" -p { port } " ,
132+ Path (__file__ ).parent / "bin" / "runner" ,
133+ (Path (__file__ ).parent / "data" / "flask" ).as_posix (),
134+ f" { Path (sys .executable ).as_posix ()} -m flask run -p { port } " ,
135135 ]
136136 print (args )
137137 env = {
138+ "APPMAP_DISABLE_LOG_FILE" : "false" ,
138139 "FLASK_APP" : "flaskapp.py" ,
139140 "FLASK_DEBUG" : flask_debug ,
140141 "PYTHONUNBUFFERED" : "1" ,
141142 "APPMAP_OUTPUT_DIR" : "/tmp" ,
142143 ** server_env ,
143144 }
144145
145- xprocess .ensure ("myserver" , Starter )
146+ pid , logpath = xprocess .ensure ("myserver" , Starter )
147+ print (f"pid: { pid } logpath: { logpath } " )
146148 yield NS (debug = debug , url = f"http://{ host } :{ port } " )
147149 xprocess .getinfo ("myserver" ).terminate ()
148150
You can’t perform that action at this time.
0 commit comments