Skip to content
This repository was archived by the owner on Feb 2, 2024. It is now read-only.

Commit d1af2d6

Browse files
Merge pull request #352 from samir-nasibli/benchamrk_ci_integration
extended test mode for benchmarks
2 parents 7e8af7d + a6e7a09 commit d1af2d6

1 file changed

Lines changed: 17 additions & 2 deletions

File tree

buildscripts/test.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,12 @@
5454

5555
# Parse input arguments
5656
parser = argparse.ArgumentParser()
57-
parser.add_argument('--test-mode', default='conda', choices=['conda', 'package', 'develop'],
57+
parser.add_argument('--test-mode', default='conda', choices=['conda', 'package', 'develop', 'benchmark'],
5858
help="""Test mode:
5959
conda: use conda-build to run tests (default and valid for conda package-type)
6060
package: create test environment, install package there and run tests
61-
develop: run tests for sdc package already installed in develop mode""")
61+
develop: run tests for sdc package already installed in develop mode
62+
benchmark: run benchmark tests for sdc""")
6263
parser.add_argument('--package-type', default='conda', choices=['conda', 'wheel'],
6364
help='Package to test: conda or wheel, default = conda')
6465
parser.add_argument('--python', default='3.7', choices=['3.6', '3.7', '3.8'],
@@ -75,6 +76,8 @@
7576
parser.add_argument('--use-numba-master', action='store_true',
7677
help=f'Test with Numba master from {numba_master_channel}')
7778
parser.add_argument('--channel-list', default=None, help='List of channels to use: "-c <channel> -c <channel>"')
79+
parser.add_argument('--benchmark-argv', default='sdc.tests.tests_perf',
80+
help='Run performance testing for all or a sigle one"')
7881

7982
args = parser.parse_args()
8083

@@ -87,6 +90,7 @@
8790
run_coverage = args.run_coverage
8891
channel_list = args.channel_list
8992
use_numba_master = args.use_numba_master
93+
benchmark_argv = args.benchmark_argv
9094
numba_channel = numba_master_channel if use_numba_master is True else args.numba_channel
9195
assert conda_prefix is not None, 'CONDA_PREFIX is not defined; Please use --conda-prefix option or activate your conda'
9296

@@ -188,3 +192,14 @@
188192
run_command(f'{test_env_activate} && {test_script}')
189193

190194
format_print(f'Tests for {package_type} packages are PASSED')
195+
196+
# Benchmark tests
197+
if test_mode == 'benchmark':
198+
os.chdir(os.path.dirname(sdc_src))
199+
sdc_packages = get_sdc_build_packages(build_folder)
200+
for package in sdc_packages:
201+
if '.tar.bz2' in package and package_type == 'conda':
202+
format_print(f'Run benchmark tests for sdc conda package: {package}')
203+
create_conda_env(conda_activate, test_env, python, sdc_env['test'] + ['openpyxl'], conda_channels)
204+
run_command(f'{test_env_activate} && conda install -y {package}')
205+
run_command(f'{test_env_activate} && python -W ignore -m sdc.runtests {benchmark_argv}')

0 commit comments

Comments
 (0)