Skip to content

Commit

Permalink
add --excludelist option to run.py and the actual list (exclude_list.…
Browse files Browse the repository at this point in the history
…txt). the intention is to run the excluded tests as a separate (multinode) jenkins job.
  • Loading branch information
ericeckstrand committed Jan 16, 2016
1 parent 17c52fc commit 981447b
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 2 deletions.
2 changes: 2 additions & 0 deletions scripts/exclude_list.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
runit_deeplearning_MNIST_checkpoint_large.R
runit_deeplearning_MNIST_large.R
49 changes: 47 additions & 2 deletions scripts/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -896,6 +896,7 @@ def __init__(self,
self.on_hadoop = on_hadoop
self.perf = perf
self.perf_file = None
self.exclude_list = []

if (use_cloud):
node_num = 0
Expand Down Expand Up @@ -977,6 +978,35 @@ def read_test_list_file(self, test_list_file):
print("")
sys.exit(1)

def read_exclude_list_file(self, exclude_list_file):
"""
Read in a file of excluded tests line by line. Each line in the file is a test
to NOT add to the test run.
@param exclude_list_file: Filesystem path to a file with a list of tests to NOT run.
@return: none
"""
try:
f = open(exclude_list_file, "r")
s = f.readline()
while (len(s) != 0):
stripped = s.strip()
if (len(stripped) == 0):
s = f.readline()
continue
if (stripped.startswith("#")):
s = f.readline()
continue
self.exclude_list.append(stripped)
s = f.readline()
f.close()
except IOError as e:
print("")
print("ERROR: Failure reading exclude list: " + exclude_list_file)
print(" (errno {0}): {1}".format(e.errno, e.strerror))
print("")
sys.exit(1)

def build_test_list(self, test_group, run_small, run_medium, run_large, run_xlarge, nopass, nointernal):
"""
Recursively find the list of tests to run and store them in the object.
Expand Down Expand Up @@ -1105,8 +1135,11 @@ def add_test(self, test_path):
test_short_dir = self._calc_test_short_dir(test_path)

test = Test(abs_test_dir, test_short_dir, test_file, self.output_dir, self.hadoop_namenode, self.on_hadoop)
self.tests.append(test)
self.tests_not_started.append(test)
if (test_path.split('/')[-1] in self.exclude_list):
print("INFO: Skipping {0} because it was placed on the exclude list.".format(test_path))
else:
self.tests.append(test)
self.tests_not_started.append(test)

def start_clouds(self):
"""
Expand Down Expand Up @@ -1656,6 +1689,7 @@ def _remove_cloud(self, ip, port):
g_wipe_output_dir = False
g_test_to_run = None
g_test_list_file = None
g_exclude_list_file = None
g_test_group = None
g_run_small = True
g_run_medium = True
Expand Down Expand Up @@ -1757,6 +1791,7 @@ def usage():
print("")
print(" --testlist A file containing a list of tests to run (for example the")
print(" 'failed.txt' file from the output directory).")
print(" --excludelist A file containing a list of tests to NOT run.")
print("")
print(" --testgroup Test a group of tests by function:")
print(" pca, glm, kmeans, gbm, rf, deeplearning, algos, golden, munging")
Expand Down Expand Up @@ -1867,6 +1902,7 @@ def parse_args(argv):
global g_wipe_output_dir
global g_test_to_run
global g_test_list_file
global g_exclude_list_file
global g_test_group
global g_run_small
global g_run_medium
Expand Down Expand Up @@ -1950,6 +1986,11 @@ def parse_args(argv):
if (i > len(argv)):
usage()
g_test_list_file = argv[i]
elif (s == "--excludelist"):
i += 1
if (i > len(argv)):
usage()
g_exclude_list_file = argv[i]
elif (s == "--testgroup"):
i += 1
if (i > len(argv)):
Expand Down Expand Up @@ -2126,6 +2167,7 @@ def main(argv):
global g_failed_output_dir
global g_test_to_run
global g_test_list_file
global g_exclude_list_file
global g_test_group
global g_runner
global g_nopass
Expand Down Expand Up @@ -2192,6 +2234,9 @@ def main(argv):
testreport_dir, g_r_pkg_ver_chk, g_hadoop_namenode, g_on_hadoop, g_perf)

# Build test list.
if (g_exclude_list_file is not None):
g_runner.read_exclude_list_file(g_exclude_list_file)

if (g_test_to_run is not None):
g_runner.add_test(g_test_to_run)
elif (g_test_list_file is not None):
Expand Down

0 comments on commit 981447b

Please sign in to comment.