]> mj.ucw.cz Git - moe.git/blobdiff - t/moe/tasktypes/dummy.py
Make logs global (class was stupid)
[moe.git] / t / moe / tasktypes / dummy.py
index 72293c35b1acd5143b3acb620232fb157537475a..b8fa942fe07db68e81bbe23231875dcc4f602f67 100644 (file)
@@ -7,33 +7,18 @@ Runs the test pipeline for each TEST
 """
 
 import moe.config
+import moe.testutils
 
 def init(e):
       
     def hook_m_50(e):
        e.log.info('Here should be compiling')
 
-    e.main_pipe.insert(50, 'dummy tasktype hook_m_50', hook_m_50)
+    e.main_pipe.insert(50, hook_m_50)
     
-    def hook_m_60(e):
-       e.log.info('Here we run test pipeline')
-       tests = e['TESTS'].split()
-       for t in tests:
-           e.log.info('Running test %s' % t)
-           e.log.user.info('TEST %s ...' % t)
-           with e.config.parse("TEST='"+t+"'", level=70, source='<dummy tasktype>'): 
-             e.test_pipe.run(e=e)
-           ## The old (but proper, as the above is vulnerable to injections by including "'" !) way was:
-           #op = moe.config.Operation('SET', None, moe.config.ConfigExpression([t]), level=70, source='<dummy tasktype>')
-           #testvar = e.config.lookup('TEST')
-           ## Add and remove operation setting 'TEST="..."'
-           #testvar.add_operation(op)
-           #e.test_pipe.run(e=e)
-           #testvar.remove_operation(op)
-    
-    e.main_pipe.insert(60, 'dummy tasktype hook_m_60', hook_m_60) 
+    e.main_pipe.insert(60, moe.testutils.hook_run_tests, desc='Run testcases') 
     
     def hook_t_30(e):
        e.log.info("Maybe we should do something? Nah...")
     
-    e.test_pipe.insert(30, 'dummy tasktype hook_t_30', hook_t_30) 
+    e.test_pipe.insert(30, hook_t_30)