Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-webui
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-webui
Commits
ae40447d
Commit
ae40447d
authored
6 years ago
by
Alexander Schlemmer
Browse files
Options
Downloads
Patches
Plain Diff
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
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
makefile
+4
-1
4 additions, 1 deletion
makefile
misc/unit_test_http_server.py
+10
-3
10 additions, 3 deletions
misc/unit_test_http_server.py
with
14 additions
and
4 deletions
makefile
+
4
−
1
View file @
ae40447d
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
misc/unit_test_http_server.py
+
10
−
3
View file @
ae40447d
...
...
@@ -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
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment