[PATCH] [WOK] Issue #726 - solve ImportError on kimchi tests

From: Paulo Vital <pvital@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@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

On 01/09/2015 18:44, pvital@linux.vnet.ibm.com wrote:
From: Paulo Vital <pvital@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@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
Why is it needed? Maybe we should start working on completely split the build process, creating one for wok and other one for kimchi.
./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

On Tue, 2015-09-08 at 12:35 -0300, Aline Manera wrote:
On 01/09/2015 18:44, pvital@linux.vnet.ibm.com wrote:
From: Paulo Vital <pvital@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@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
Why is it needed?
The link is necessary to resolve the imports from wok that Kimchi tests could not find, even setting the PYTHONPATH on run_tests.sh script. This is a temporally solution, until we find the best way to build and execute the tests using wok and kimchi from different repositories.
Maybe we should start working on completely split the build process, creating one for wok and other one for kimchi.
I completely agree and I'm looking for these issues now.
./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
participants (3)
-
Aline Manera
-
Paulo Ricardo Paz Vital
-
pvital@linux.vnet.ibm.com