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

Commit

Permalink
Merge 9f42136 into eb97bad
Browse files Browse the repository at this point in the history
  • Loading branch information
Vyacheslav-Smirnov committed Aug 9, 2019
2 parents eb97bad + 9f42136 commit 5348eb9
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 5 deletions.
4 changes: 2 additions & 2 deletions buildscripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
source activate $CONDA_ENV

# generate test data for test_io
python hpat/tests/gen_test_data.py
python -m hpat.tests.gen_test_data

if [ "$RUN_COVERAGE" == "yes" ]; then
export PYTHONPATH=.
coverage erase
coverage run --source=./hpat --omit ./hpat/ml/*,./hpat/xenon_ext.py,./hpat/ros.py,./hpat/cv_ext.py,./hpat/tests/* -m unittest
else
mpiexec -n $NUM_PES python -u -m unittest -v
mpiexec -n $NUM_PES python -u -m hpat.runtests -v
fi
35 changes: 34 additions & 1 deletion hpat/runtests.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,43 @@
import os
import unittest
import hpat.tests

from hpat.tests.tests_config import tests_to_repeat

repeat_test_number = 2
if 'REPEAT_TEST_NUMBER' in os.environ:
repeat_test_number = int(os.environ['REPEAT_TEST_NUMBER'])

""" Decorator to repeat test execution """
def repeat_test(test):
def repeat_test_wrapper(*args, **kwargs):
for _ in range(repeat_test_number):
test(*args, **kwargs)

return repeat_test_wrapper

"""
Wrap found tests to execute it multiple times using repeat_test decorator
loadTestsFromModule returns suiteClass with _tests member
which contains further suiteClass instanses:
hpat_tests = suiteClass(hpat.tests)
suiteClass(hpat.tests)._tests = [suiteClass(hpat.tests.TestBasic), suiteClass(hpat.tests.TestDataFrame), ...]
suiteClass(hpat.tests)._tests[0] = suiteClass(hpat.tests.TestBasic)
suiteClass(hpat.tests.TestBasic)._tests = [TestBasic testMethod=test_array_reduce, ...]
test.id() returns the string like hpat.tests.test_basic.TestBasic.test_array_reduce
"""
def load_tests(loader, tests, pattern):
suite = unittest.TestSuite()
suite.addTests(loader.loadTestsFromModule(hpat.tests))
hpat_tests = loader.loadTestsFromModule(hpat.tests)

print('Notice: {} tests will be executed {} times'.format(len(tests_to_repeat), repeat_test_number))
for i in range(len(hpat_tests._tests)):
for j in range(len(hpat_tests._tests[i]._tests)):
if hpat_tests._tests[i]._tests[j].id().split('.')[-1] in tests_to_repeat:
hpat_tests._tests[i]._tests[j] = repeat_test(hpat_tests._tests[i]._tests[j])

suite.addTests(hpat_tests)
return suite


Expand Down
4 changes: 2 additions & 2 deletions hpat/tests/test_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -1288,9 +1288,9 @@ def test_impl():
Exact errors:
1. Segmentation fault in TestBasic.test_rebalance
2. FAIL in TestBasic.test_astype with following error message:
test_astype (hpat.tests.test_basic.TestBasic) ...
test_astype (hpat.tests.test_basic.TestBasic) ...
Fatal error in MPI_Allreduce: Message truncated, error stack:
MPI_Allreduce(907)..................: MPI_Allreduce(sbuf=0x7ffe3b734128, rbuf=0x7ffe3b734120, count=1,
MPI_Allreduce(907)..................: MPI_Allreduce(sbuf=0x7ffe3b734128, rbuf=0x7ffe3b734120, count=1,
MPI_LONG_LONG_INT, MPI_SUM, MPI_COMM_WORLD) failed
MPIR_Allreduce_impl(764)............:
MPIR_Allreduce_intra(238)...........:
Expand Down
52 changes: 52 additions & 0 deletions hpat/tests/tests_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
tests_to_repeat = [
'test_df_values_parallel1',
'test_sort_parallel_single_col',
'test_sort_parallel',
'test_agg_multikey_parallel',
'test_agg_parallel',
'test_agg_parallel_sum',
'test_agg_parallel_count',
'test_agg_parallel_mean',
'test_agg_parallel_min',
'test_agg_parallel_max',
'test_agg_parallel_var',
'test_agg_parallel_std',
'test_agg_parallel_str',
'test_agg_parallel_all_col',
'test_agg_parallel_as_index',
'test_pivot_parallel',
'test_crosstab_parallel1',
'test_quantile_parallel',
'test_quantile_parallel_float_nan',
'test_quantile_parallel_int',
'test_nunique_parallel',
'test_nunique_str_parallel',
'test_unique_parallel',
'test_unique_str_parallel',
'test_str_replace_regex_parallel',
'test_str_split_parallel',
'test_str_get_parallel',
'test_str_flatten_parallel',
'test_h5_read_parallel',
'test_h5_write_parallel',
'test_csv_infer_parallel1',
'test_csv_infer_skip_parallel1',
'test_csv_parallel1',
'test_csv_str_parallel1',
'test_write_csv_parallel1',
'test_join_mutil_parallel1',
'test_join_left_parallel1',
'test_join_datetime_parallel1',
'test_merge_asof_parallel1',
'test_join_cat_parallel1',
'test_fixed_parallel1',
'test_fixed_parallel_apply1',
'test_variable_parallel1',
'test_variable_apply_parallel1',
'test_series_dropna_str_parallel1',
'test_series_nlargest_parallel1',
'test_series_nsmallest_parallel1',
'test_series_head_index_parallel1',
'test_series_median_parallel1',
'test_series_argsort_parallel',
'test_series_sort_values_parallel1']

0 comments on commit 5348eb9

Please sign in to comment.