Skip to content

Commit

Permalink
only benchmarks for first CI check
Browse files Browse the repository at this point in the history
  • Loading branch information
Kishan-Ved committed Jul 5, 2024
1 parent d9ce6a8 commit 45853fc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ jobs:
- name: Run tests
run: |
python -c "import pydatastructs; pydatastructs.test(include_benchmarks=True)"
python -c "import pydatastructs; pydatastructs.test(only_benchmarks=True)"
- name: Build Documentation
run: |
Expand Down
2 changes: 0 additions & 2 deletions pydatastructs/trees/tests/test_binary_trees.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,6 @@ def _test_AVLTree(backend):

assert a5.rank(-1) is None
def test_select_rank(expected_output):
if backend == Backend.CPP:
return
output = []
for i in range(len(expected_output)):
output.append(a5.select(i + 1).key)
Expand Down
12 changes: 7 additions & 5 deletions pydatastructs/utils/testing_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

SKIP_FILES = ['testing_util.py']

def test(submodules=None, include_benchmarks=False,
def test(submodules=None, only_benchmarks=False,
benchmarks_size=1000, **kwargs):
"""
Runs the library tests using pytest
Expand Down Expand Up @@ -52,11 +52,12 @@ def test(submodules=None, include_benchmarks=False,
else:
raise Exception("Submodule should be of type: str or module")
if sub in path:
if not include_benchmarks:
if not only_benchmarks:
if not 'benchmarks' in path:
test_files.append(path)
else:
test_files.append(path)
if 'benchmarks' in path:
test_files.append(path)
break
else:
for path in glob.glob(f'{ROOT_DIR}/**/test_*.py', recursive=True):
Expand All @@ -67,11 +68,12 @@ def test(submodules=None, include_benchmarks=False,
break
if skip_test:
continue
if not include_benchmarks:
if not only_benchmarks:
if not 'benchmarks' in path:
test_files.append(path)
else:
test_files.append(path)
if 'benchmarks' in path:
test_files.append(path)

extra_args = []
if not kwargs.get("n", False) is False:
Expand Down

0 comments on commit 45853fc

Please sign in to comment.