Open
Description
The test format implementation is difficult to work with for a number of reasons.
Cannot Run Coverage Code Locally
Attempting to run
pytest tests/test_extensions.py::test_substrait_extension_coverage
locally results in errors like
__________________________________________________ ERROR collecting tests/test_extensions.py __________________________________________________
ImportError while importing test module '/Users/victor.barua/scratch/substrait/tests/test_extensions.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
tests/test_extensions.py:4: in <module>
from tests.coverage.case_file_parser import load_all_testcases
tests/coverage/case_file_parser.py:4: in <module>
from antlr4 import CommonTokenStream, FileStream
E ModuleNotFoundError: No module named 'antlr4'
=========================================================== 1 error in 0.02 seconds ===========================================================
ERROR: not found: /Users/victor.barua/scratch/substrait/tests/test_extensions.py::test_substrait_extension_coverage
(no name '/Users/victor.barua/scratch/substrait/tests/test_extensions.py::test_substrait_extension_coverage' in any of [<Module test_extensions.py>])
even with then antlr4 runtime available
➜ pip3 freeze
antlr4-python3-runtime==4.13.2
...
As a result I cannot test changes locally AND because this is included as a pre-commit hook, not of my commits are able to use the hooks.
Adding Tests Requires Mucking With Coverage Asserts
When trying to fix the lints in #769 as a result of me adding coverage to existing tests, I have to muck with some of the numbers in
substrait/tests/test_extensions.py
Lines 10 to 38 in 2d8b1b6
Desired State
In order of increasing opinionatedness
- If were going to have Python tooling, we should have way to configure environments reproducibly (i.e. requirements.tx/pipfiles/etc) so that folks can execute test and hooks locally.
- We should seperate out the execution of the tests from coverage.
- CI should block on test failures, but not on coverage changes. Coverage should be a report that we can look at.
Metadata
Assignees
Labels
No labels