Skip to content
Snippets Groups Projects
Commit ae40447d authored by Alexander Schlemmer's avatar Alexander Schlemmer
Browse files

new make entry to run and keep a qunit test server

parent e81e71b0
No related branches found
No related tags found
No related merge requests found
......@@ -49,7 +49,10 @@ PORT = 8000
TIMEOUT = 200
XVFB-RUN = xvfb-run -e /dev/stderr
run-test-server: test
cd $(PUBLIC_DIR); $(MISC_DIR)/unit_test_http_server.py $(PORT) $(TIMEOUT); echo $$? > $(ROOT_DIR)/.server_done
cd $(PUBLIC_DIR); $(MISC_DIR)/unit_test_http_server.py $(PORT) $(TIMEOUT) False; echo $$? > $(ROOT_DIR)/.server_done
keep-test-server:
cd $(PUBLIC_DIR); $(MISC_DIR)/unit_test_http_server.py $(PORT) $(TIMEOUT) True; echo $$? > $(ROOT_DIR)/.server_done
run-qunit:
# start server
......
......@@ -59,7 +59,11 @@ class UnitTestsHandler(SimpleHTTPRequestHandler):
Shut down the server with an exit code which depends on the success of
the unit test suite - If the tests succeeded the server exists with 0,
otherwise with 1.
If the server has the ignore_done flag set this method immediately returns.
"""
if self.server.ignore_done:
return
#pylint: disable=protected-access
post_data = self.log()
if "SUCCESS" in post_data:
......@@ -85,12 +89,15 @@ class UnitTestHTTPServer(HTTPServer):
A HTTP server which handles the request to the webcaosdb sources and the
tests and servers as a logger when POST request are send to the `log`
resource.
ignore_done: If set to true the server does not terminate on receiving a "/Done".
"""
def __init__(self, server_address, timeout):
def __init__(self, server_address, timeout, ignore_done):
super(UnitTestHTTPServer, self).__init__(server_address,
UnitTestsHandler)
self.timeout = timeout
self.ignore_done = ignore_done
self._keep_running = True
self._exit_message = None
self._exit_code = None
......@@ -122,4 +129,4 @@ class UnitTestHTTPServer(HTTPServer):
UnitTestHTTPServer(server_address=('127.0.0.1', int(sys.argv[1])),
timeout=float(sys.argv[2])).start()
timeout=float(sys.argv[2]), ignore_done=(sys.argv[3]=="True")).start()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment