In [ ]:
import time
from ROOT_testing import Experiment
#--------------------------------------------------------------------------------
### ROOT TEST ORCHESTRATOR ###
#
#
### ___---*** WARNING ***---___ ###
#
# Please DO follow these instructions to set up a proper directory tree:
#
# For testing purposes, we impose a strict nomenclature on the folder tree
# to distinguish between different machines
#
# This is the expected folder tree
# .
# |__ ENTF
# | |__ <hostname>
# | |__ workdir
# | | | logs
# | | | processing
# | |__ entf # Clone of the git repository
# | | README.md
# | | LICENSE
# | |__ IO_testing
#
#
# It is of primary importance to match such directory tree and properly define the <hostname>
# Indeed, the <hostname> is used to infer the machine_ID and report the results to Grafana.
#
# Eventually, the machine_ID can be specified manually, by using the parameter
# "machine_id=Something" in the call to the Experiment() class.
#
# Experiment class:
#__init__(self, folder_in, folder_out=CWD, machine_id=None, ttype=None, exclude_list=None, sanity_check=True, gt_fname=None, to_grafana=True):
#--------------------------------------------------------------------------------
#--------------------------------------------------------------------------------
# Define the output folder
#--------------------------------------------------------------------------------
OUTPUT_FOLDER = "../../workdir" # This notebook is inside the IO_testing folder on the git repo
#--------------------------------------------------------------------------------
# Choose whether you want the sanity check on output notebooks
#--------------------------------------------------------------------------------
CHECK_OUTPUT = True
#--------------------------------------------------------------------------------
# Choose whether you want to publish the results on Grafana
#--------------------------------------------------------------------------------
GRAFANA = True
#--------------------------------------------------------------------------------
# Orchestrator wait times
# Define wait times between consecutive tests and test runs
#--------------------------------------------------------------------------------
WAIT_TEST = 60
WAIT_CYCLE = 600
#--------------------------------------------------------------------------------
# Run the tests forever
#--------------------------------------------------------------------------------
i=0
while (True):
i += 1
print "Test no. %d\n" % i
#
# Testing io tutorials
print "\nRunning IO tutorials..."
EXCLUDE_IO = ["copyFiles.C.nbconvert.ipynb", "mergeSelective.C.nbconvert.ipynb"]
io_test = Experiment("converted_notebooks/io", folder_out=OUTPUT_FOLDER, \
ttype="io", exclude_list=EXCLUDE_IO, \
sanity_check=CHECK_OUTPUT, gt_fname="converted_notebooks/io_md5.groundtruth", \
to_grafana=GRAFANA)
io_test.run()
time.sleep(WAIT_TEST)
#
# Testing math tutorials
print "\nRunning MATH tutorials..."
EXCLUDE_MATH = ["testUnfold2.C.nbconvert.ipynb", "testUnfold4.C.nbconvert.ipynb", "testUnfold5d.C.nbconvert.ipynb", "testrandom.C.nbconvert.ipynb"]
math_test = Experiment("converted_notebooks/math", folder_out=OUTPUT_FOLDER,
ttype="math", exclude_list=EXCLUDE_MATH, \
sanity_check=CHECK_OUTPUT, gt_fname="converted_notebooks/math_md5.groundtruth", \
to_grafana=GRAFANA)
math_test.run()
time.sleep(WAIT_TEST)
#
# Testing tree tutorials
print "\nRunning TREE tutorials..."
EXCLUDE_TREE = ["copytree.C.nbconvert.ipynb", "copytree2.C.nbconvert.ipynb", "copytree3.C.nbconvert.ipynb", "hsimpleProxyDriver.C.nbconvert.ipynb", "htest.C.nbconvert.ipynb", "run_h1analysis.C.nbconvert.ipynb"]
tree_test = Experiment("converted_notebooks/tree", folder_out=OUTPUT_FOLDER, \
ttype="tree", exclude_list=EXCLUDE_TREE, \
sanity_check=CHECK_OUTPUT, gt_fname="converted_notebooks/tree_md5.groundtruth", \
to_grafana=GRAFANA)
tree_test.run()
time.sleep(WAIT_TEST)
time.sleep(WAIT_CYCLE)
In [ ]: