From 81aacf13ce0202c0b3a738b2b211803c90a4ac2e Mon Sep 17 00:00:00 2001 From: Kishan-Ved Date: Fri, 5 Jul 2024 22:36:27 +0530 Subject: [PATCH] CI Job with only benchmark tests --- .github/workflows/ci.yml | 2 +- pydatastructs/utils/testing_util.py | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bc75a85da..b416eb02d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: | diff --git a/pydatastructs/utils/testing_util.py b/pydatastructs/utils/testing_util.py index 284052d89..6024912ba 100644 --- a/pydatastructs/utils/testing_util.py +++ b/pydatastructs/utils/testing_util.py @@ -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 @@ -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): @@ -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: