Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken integration tests #1076

Closed
adriangonz opened this issue Nov 8, 2019 · 0 comments · Fixed by #1077
Closed

Broken integration tests #1076

adriangonz opened this issue Nov 8, 2019 · 0 comments · Fixed by #1077
Assignees

Comments

@adriangonz
Copy link
Contributor

Context

The integration tests seem to be failing at the moment with the following error:

Traceback:
test_s2i_python.py:5: in <module>
    from seldon_utils import *
seldon_utils.py:3: in <module>
    from seldon_core.proto import prediction_pb2
/usr/local/lib/python3.6/site-packages/seldon_core/proto/prediction_pb2.py:17: in <module>
    from seldon_core.proto.tensorflow.core.framework import tensor_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__pb2
/usr/local/lib/python3.6/site-packages/seldon_core/proto/tensorflow/core/framework/__init__.py:5: in <module>
    from tensorflow.core.framework import tensor_pb2, types_pb2, tensor_shape_pb2
E   ImportError: cannot import name 'tensor_pb2'

The cause of the error is that a new folder called tensorflow gets created in the seldon-core/testing/scripts folder. Using Python 3.7, if you run import tensorflow this folder can get "imported" as a namespace implicitly. This behaviour was introduced with Python 3.3 and it's defined in PEP 420.

We use import tensorflow as a presence check for tensorflow. Since it succeeds (thanks to the namesake folder), seldon_core tries to import the tensorflow protobuf definitions. However, tensorflow is not really present and these imports will fail with the stacktrace above.

Suggested fix

Instead of just importing tensorflow, we can improve how we currently check for tensorflow's presence by importing one of the functions that we actually use on the code (e.g. from tensorflow import make_ndarray).

@adriangonz adriangonz self-assigned this Nov 8, 2019
@adriangonz adriangonz changed the title Failing integration tests Broken integration tests Nov 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant