]> mj.ucw.cz Git - moe.git/blob - t/moe/tasktypes/dummy.py
c8b7c73b232b9b70cfc34f99e16a5283a470c13f
[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(e):
12         e.log.info('Here should be compiling')
13
14     e.main_pipe.insert(50, 'dummy tasktype hook_m_50', hook_m_50)
15     
16     def hook_m_60(e):
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_pipe.insert(60, 'dummy tasktype hook_m_60', hook_m_60) 
31     
32     def hook_t_30(e):
33         e.log.info("Maybe we should do something? Nah...")
34     
35     e.test_pipe.insert(30, 'dummy tasktype hook_t_30', hook_t_30)