Skip to content

pytest unit test fail in ludwig Docker container #405

@jimthompson5802

Description

@jimthompson5802

Describe the bug
pytest unit test fails in Docker container built from ludwig Dockerfile.

To Reproduce
Steps to reproduce the behavior:

  1. Bild Ludwig Docker image: cd ludwig && docker build -t ludwig .
  2. Run Ludwig docker container: docker run -it --rm --entrypoint /bin/bash ludwig
  3. Within the container execute the following:
cd /ludwig
pytest  -v tests/integration_tests/test_api.py

Expected behavior
The tests should have passed, instead of failing

Screenshots
root@a69758374059:/ludwig# pytest -v tests/integration_tests/test_api.py
======================================================== test session starts =========================================================
platform linux -- Python 3.6.8, pytest-5.0.0, py-1.8.0, pluggy-0.12.0 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /ludwig
collected 1 item

tests/integration_tests/test_api.py::test_api_intent_classification ERROR [100%]

=============================================================== ERRORS ===============================================================
__________________________________________ ERROR at setup of test_api_intent_classification __________________________________________
file /ludwig/tests/integration_tests/test_api.py, line 72
def test_api_intent_classification(csv_filename):
E fixture 'csv_filename' not found

  available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, doctest_namespace, monkeypatch, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory
  use 'pytest --fixtures [testpath]' for help on them.

/ludwig/tests/integration_tests/test_api.py:72
========================================================== warnings summary ==========================================================
/usr/local/lib/python3.6/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py:15
/usr/local/lib/python3.6/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py:15: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
import imp

/usr/local/lib/python3.6/dist-packages/tensorflow/contrib/lite/python/init.py:26
/usr/local/lib/python3.6/dist-packages/tensorflow/contrib/lite/python/init.py:26: PendingDeprecationWarning: WARNING: TF Lite has moved from tf.contrib.lite to tf.lite. Please update your imports. This will be a breaking error in TensorFlow version 2.0.
_warnings.warn(WARNING, PendingDeprecationWarning)

-- Docs: https://docs.pytest.org/en/latest/warnings.html
================================================ 2 warnings, 1 error in 2.68 seconds =================================================
root@a69758374059:/ludwig# exit

Environment (please complete the following information):

  • OS: MacOS 10.14.5, Docker Desktop forMac 2.0.0.3
  • Version
  • Python version: 3.6.8 (from ludwig Dockerfile)
  • Ludwig version: 0.1.2

*Additional context
I noticed PR #403 Commit 3533a4b removed the imports for the required pytest fixtures from tests/integration_tests/test_api.py, e.g.,

from tests.fixtures.filenames import csv_filename

Is there a different way to run the pytest tests? If desired, I can submit a PR to add the missing imports. I just need some guidance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions