-
Notifications
You must be signed in to change notification settings - Fork 579
Description
As far as I can tell translateAlgebra tests (stuff in test/translate_algebra/...) are not integrated with other unit tests and will not run when run_tests.py or nosetests run.
$ \rm -rv .venv
$ python3.7 -m venv .venv
$ .venv/bin/python3 -m pip install -r requirements.txt -r requirements.dev.txt
$ export PYTHONPATH=$(readlink -f .):$(readlink -f .venv)
$ .venv/bin/python test/translate_algebra/main.py
Traceback (most recent call last):
File "test/translate_algebra/main.py", line 1, in <module>
from test_base import Test, TestExecution, format_text
File "/home/iwana/d.x/github.com/RDFLib/rdflib/test/translate_algebra/test_base.py", line 1, in <module>
import pandas as pd
ModuleNotFoundError: No module named 'pandas'
$ .venv/bin/python3 -m pip install pandas
$ .venv/bin/python test/translate_algebra/main.py
Traceback (most recent call last):
File "test/translate_algebra/main.py", line 1, in <module>
from test_base import Test, TestExecution, format_text
File "/home/iwana/d.x/github.com/RDFLib/rdflib/test/translate_algebra/test_base.py", line 5, in <module>
from tabulate import tabulate
ModuleNotFoundError: No module named 'tabulate'
$ .venv/bin/python3 -m pip install tabulate
Furthermore it seems these tests need pandas and tabulate and seems to be expecting a file test/config.ini with a section TEST
$ .venv/bin/python test/translate_algebra/main.py
Executing tests ...
Traceback (most recent call last):
File "test/translate_algebra/main.py", line 889, in <module>
t.run_tests()
File "/home/iwana/d.x/github.com/RDFLib/rdflib/test/translate_algebra/test_base.py", line 107, in run_tests
logging.getLogger().setLevel(int(self.test_config.get("TEST", "log_level")))
File "/usr/lib64/python3.7/configparser.py", line 780, in get
d = self._unify_values(section, vars)
File "/usr/lib64/python3.7/configparser.py", line 1146, in _unify_values
raise NoSectionError(section) from None
configparser.NoSectionError: No section: 'TEST'
rdflib/test/translate_algebra/test_base.py
Lines 62 to 65 in f4e1efd
| test_module_path = os.path.dirname(sys.modules[__class__.__module__].__file__) | |
| config_path = test_module_path + "/../config.ini" | |
| self.test_config = configparser.ConfigParser() | |
| self.test_config.read(config_path) |
rdflib/test/translate_algebra/test_base.py
Line 107 in f4e1efd
| logging.getLogger().setLevel(int(self.test_config.get("TEST", "log_level"))) |
Ideally this should be integrated with the rest of the tests, it should run when run_tests.py runs and when drone CI runs, it should also have all dependencies in requirements.dev.txt and it should have all required config files.
The best option would be to base the test system used for translateAlgebra on python's unittest module.
See also:
- Implemented function translateAlgebra. This functions takes a SPARQL … #1322 - The original PR that introduced
translateAlgebra - Fixed one issue with SUBSTR and CONCAT. Also fixed another issue with… #1361 - Some fixes (not merged yet)