<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 01/23/2014 03:48 AM, Mark Wu wrote:<br>
</div>
<blockquote cite="mid:52E0AD21.6080905@linux.vnet.ibm.com"
type="cite">On 01/23/2014 11:29 AM, <a class="moz-txt-link-abbreviated" href="mailto:shaohef@linux.vnet.ibm.com">shaohef@linux.vnet.ibm.com</a>
wrote:
<br>
<blockquote type="cite">From: ShaoHe Feng
<a class="moz-txt-link-rfc2396E" href="mailto:shaohef@linux.vnet.ibm.com"><shaohef@linux.vnet.ibm.com></a>
<br>
<br>
$ sudo ./run_tests.sh test_rest
<br>
Failed to import plugin plugins.sample.Drawings
<br>
<br>
That's because plugin is not in src/
<br>
<br>
Signed-off-by: ShaoHe Feng <a class="moz-txt-link-rfc2396E" href="mailto:shaohef@linux.vnet.ibm.com"><shaohef@linux.vnet.ibm.com></a>
<br>
---
<br>
tests/run_tests.sh.in | 4 ++--
<br>
1 file changed, 2 insertions(+), 2 deletions(-)
<br>
<br>
diff --git a/tests/run_tests.sh.in b/tests/run_tests.sh.in
<br>
index 2baf66d..038e8fa 100644
<br>
--- a/tests/run_tests.sh.in
<br>
+++ b/tests/run_tests.sh.in
<br>
@@ -31,7 +31,7 @@ else
<br>
fi
<br>
<br>
if [ "$HAVE_UNITTEST" != "yes" -o "$PYTHON_VER" == "2.6" ];
then
<br>
- PYTHONPATH=../src:./ unit2 $ARGS
<br>
+ PYTHONPATH=../src:./:../ unit2 $ARGS
<br>
else
<br>
- PYTHONPATH=../src python -m unittest $ARGS
<br>
+ PYTHONPATH=../src:../ python -m unittest $ARGS
<br>
fi
<br>
</blockquote>
We don't put any test cases for plugins in test_rest. Instead,
we put them in test_plugin. the python path
<br>
has been mangled there.
<br>
<br>
</blockquote>
<br>
Despite the test cases for plugins are in test_plugin, all tests use
the same cherrypy server (and configuration) to run the tests.<br>
And when the cherrypy server starts up it tries to load all plugins
enabled because that we got an error while running other tests
(except the test_plugin)<br>
<br>
<br>
.[23/Jan/2014:17:27:45] ENGINE Waiting for child threads to
terminate...<br>
[23/Jan/2014:17:27:45] ENGINE Waiting for thread MainThread.<br>
<b>...........Failed to import plugin plugins.sample.Drawings</b><br>
[23/Jan/2014:17:27:46] ENGINE Bus STARTING<br>
[23/Jan/2014:17:27:46] ENGINE Serving on 127.0.0.1:48919<br>
<br>
<br>
Sheldon, as remembered by Mark you should remove the python path
from test_plugin and keep it only in run_tests.sh.in script<br>
<br>
diff --git a/tests/test_plugin.py b/tests/test_plugin.py<br>
index 42c87a9..607dd55 100644<br>
--- a/tests/test_plugin.py<br>
+++ b/tests/test_plugin.py<br>
@@ -22,7 +22,6 @@<br>
<br>
import json<br>
import os<br>
-import sys<br>
import unittest<br>
<br>
<br>
@@ -32,7 +31,6 @@ from functools import partial<br>
import kimchi.mockmodel<br>
import kimchi.server<br>
import utils<br>
-from kimchi import config<br>
<br>
<br>
test_server = None<br>
@@ -48,7 +46,6 @@ def setUpModule():<br>
host = '127.0.0.1'<br>
port = utils.get_free_port('http')<br>
ssl_port = None<br>
- sys.path.append(config.get_prefix())<br>
test_server = utils.run_server(host, port, ssl_port,
test_mode=True,<br>
model=model)<br>
<br>
<br>
<br>
<blockquote cite="mid:52E0AD21.6080905@linux.vnet.ibm.com"
type="cite">_______________________________________________
<br>
Kimchi-devel mailing list
<br>
<a class="moz-txt-link-abbreviated" href="mailto:Kimchi-devel@ovirt.org">Kimchi-devel@ovirt.org</a>
<br>
<a class="moz-txt-link-freetext" href="http://lists.ovirt.org/mailman/listinfo/kimchi-devel">http://lists.ovirt.org/mailman/listinfo/kimchi-devel</a>
<br>
<br>
</blockquote>
<br>
</body>
</html>