[Kimchi-devel] [PATCH] [WOK] Issue #726 - solve ImportError on kimchi tests
pvital at linux.vnet.ibm.com
pvital at linux.vnet.ibm.com
Tue Sep 1 21:44:29 UTC 2015
From: Paulo Vital <pvital at linux.vnet.ibm.com>
The split of Kimchi code into Wok and Kimchi plugin modified the import
of some classes and packages and the structure of the files store in
development tree.
This patch fixes the PyhtonPath to set the correct paths and creates the
necessary symbolic links to support the tests execution.
Signed-off-by: Paulo Vital <pvital at linux.vnet.ibm.com>
---
plugins/kimchi/tests/Makefile.am | 4 ++++
plugins/kimchi/tests/run_tests.sh.in | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/plugins/kimchi/tests/Makefile.am b/plugins/kimchi/tests/Makefile.am
index c1f6784..1c460df 100644
--- a/plugins/kimchi/tests/Makefile.am
+++ b/plugins/kimchi/tests/Makefile.am
@@ -44,6 +44,10 @@ test_config.py: test_config.py.in Makefile
check-local:
$(MKDIR_P) $(top_srcdir)/data/screenshots
+# TODO: this is not the best way to solve the ImportError problem reported
+# in issue #726, but it solves the problem. Need think better on this.
+ test -L $(abs_top_srcdir)/../../src/wok/plugins || ln -s \
+ $(abs_top_srcdir)/.. $(abs_top_srcdir)/../../src/wok/plugins
./run_tests.sh
BUILT_SOURCES = test_config.py
diff --git a/plugins/kimchi/tests/run_tests.sh.in b/plugins/kimchi/tests/run_tests.sh.in
index beef75e..5b98755 100644
--- a/plugins/kimchi/tests/run_tests.sh.in
+++ b/plugins/kimchi/tests/run_tests.sh.in
@@ -52,4 +52,4 @@ for ((i=0;i<${#LIST[@]};i++)); do
fi
done
-PYTHONPATH=../plugins:../src:../ $CMD $OPTS ${MODEL_LIST[@]} ${MOCK_LIST[@]}
+PYTHONPATH=../../../src:../ $CMD $OPTS ${MODEL_LIST[@]} ${MOCK_LIST[@]}
--
2.4.3
More information about the Kimchi-devel
mailing list