]> mj.ucw.cz Git - moe.git/blob - t/moe/tasktypes/dummy.py
Added dummy task type
[moe.git] / t / moe / tasktypes / dummy.py
1 """
2
3 Dummy task type.
4
5 Adds several info-printing hooks to both pipelines.
6 Runs the test pipeline for each TEST
7 """
8
9 def init(e):
10       
11       def hook_m_50:
12           e.log.info('Here should be compiling')
13       
14       e.main_pipeline.insert(hook_m_50, 'dummy tasktype hook_m_50', 50)
15       
16       def hook_m_60:
17           e.log.info('Here should be test pipeline running')
18           tests = e['TESTS'].split()
19           for t in tests:
20                e.log.info('Running test %s' % t)
21                e.log.user.info('TEST %s ...' % t)
22
23                op = moe.config.Operation('SET', None, t, level=70, source='<dummy tasktype>')
24                testvar = e.config.lookup('TEST')
25                # Add and remove operation setting 'TEST="..."'
26                testvar.add_operation(op)
27                e.test_pipeline.run()
28                testvar.remove_operation(op)
29       
30       e.main_pipeline.insert(hook_m_60, 'dummy tasktype hook_m_60', 60) 
31       
32       def hook_t_30:
33           e.log.info("Maybe we should do something? Nah...")
34       
35       e.test_pipeline.insert(hook_t_30, 'dummy tasktype hook_t_30', 30)