Skip to content

Commit

Permalink
ci: Fix run-test.py for module runs (#1180)
Browse files Browse the repository at this point in the history
Fixes the 'run-test.py' script so it can run module
based testing rather than only specific test files.

Ref: #1166
  • Loading branch information
lsetiawan authored Sep 22, 2023
1 parent b887be8 commit ce1e614
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .ci_helpers/run-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,15 @@
for k, v in test_to_run.items():
print(f"=== RUNNING {k.upper()} TESTS===")
print(f"Touched files: {','.join([os.path.basename(p) for p in v])}")
if all(os.path.exists(f) for f in v):
# Run specific test files
# The input files must all starts with "test" in their name
# otherwise module globbing for specific test files will
# be used
if all(f.name.startswith("test") for f in v):
# For specific test files
test_files = [str(p) for p in v]
else:
# Run all tests in a module
if k == "root":
file_glob_str = "echopype/tests/test_*.py"
cov_mod_arg = ["--cov=echopype"]
Expand Down

0 comments on commit ce1e614

Please sign in to comment.