Skip to content

Commit

Permalink
Improve test run scripts (#314)
Browse files Browse the repository at this point in the history
Improve the run scripts so they will propagate exit codes. This allows them to break the build if tests fail.
Disable the tooling integration tests since they actually fail, and will now fail the builds. This will need to be remedied (issue #313).
  • Loading branch information
OrestZborowski-SIG authored May 2, 2022
1 parent 9b9d953 commit 29a8704
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 5 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,11 @@ jobs:
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest riptable/tests
python -m riptable.tests.run
- name: Tooling integration tests
run: |
ipython -m pytest riptable/test_tooling_integration
echo "DISABLED until tooling tests can be updated"
#ipython -m riptable.test_tooling_integration.run
# disable hypothesis tests until they run faster, are more consistent, and are easier to investigate
#- name: Property based hypothesis tests
# run: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def get_matches(code_text: str, complete_text: str) -> List[str]:
assert reply['status'] == 'ok'
wait_for_idle(kc)
kc.complete(complete_text)
reply = kc.get_shell_msg(block=True, timeout=TIMEOUT)
reply = kc.get_shell_msg(timeout=TIMEOUT)
matches = reply['content']['matches']
return matches

Expand Down
26 changes: 26 additions & 0 deletions riptable/test_tooling_integration/run.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# $Id$

import pytest
import sys
import os


def run_all(extra_args=None):
"""
Run all the tooling integration tests of riptable.
Parameters
----------
extra_args : list
List of extra arguments (e.g. ['--verbosity=3'])
"""
if extra_args is None:
extra_args = []
return pytest.main(extra_args + ['-k', 'test_', os.path.dirname(__file__)])


# Usage: "ipython -m riptable.test_tooling_integration.run"
# You can add more arguments to the pytest, like "ipython -m riptable.test_tooling_integration.run --verbosity=2"
if __name__ == "__main__":
# Force ipython to exit with the exit code, as sys.exit() is caught and ignored :-/
os._exit(run_all(sys.argv[1:]))
4 changes: 2 additions & 2 deletions riptable/tests/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ def run_all(extra_args=None):
"""
if extra_args is None:
extra_args = []
pytest.main(extra_args + ['-k', 'test_', os.path.dirname(__file__)])
return pytest.main(extra_args + ['-k', 'test_', os.path.dirname(__file__)])


# Usage: "python -m riptable.tests.run"
# You can add more arguments to the pytest, like "python -m riptable.tests.run --verbosity=2"
if __name__ == "__main__":
run_all(sys.argv[1:])
sys.exit(run_all(sys.argv[1:]))

0 comments on commit 29a8704

Please sign in to comment.