OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2015 The LUCI Authors. All rights reserved. | 2 # Copyright 2015 The LUCI Authors. All rights reserved. |
3 # Use of this source code is governed under the Apache License, Version 2.0 | 3 # Use of this source code is governed under the Apache License, Version 2.0 |
4 # that can be found in the LICENSE file. | 4 # that can be found in the LICENSE file. |
5 | 5 |
6 import cStringIO | 6 import cStringIO |
7 import os | 7 import os |
8 import sys | 8 import sys |
9 import unittest | 9 import unittest |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... |
29 | 29 |
30 foo.add_step_link('read it online!', 'https://foospoemtobar.com/') | 30 foo.add_step_link('read it online!', 'https://foospoemtobar.com/') |
31 foo.add_step_summary_text('read a killer poem and took a bow') | 31 foo.add_step_summary_text('read a killer poem and took a bow') |
32 foo.trigger('{"builderName":["bar\'s fantasies"]}') | 32 foo.trigger('{"builderName":["bar\'s fantasies"]}') |
33 foo.close() | 33 foo.close() |
34 | 34 |
35 # TODO(luqui): N.B. stream interleaving is not really possible with | 35 # TODO(luqui): N.B. stream interleaving is not really possible with |
36 # subannotations, since the subannotator stream could have changed the | 36 # subannotations, since the subannotator stream could have changed the |
37 # active step. To do this right we would need to parse and re-emit | 37 # active step. To do this right we would need to parse and re-emit |
38 # subannotations. | 38 # subannotations. |
39 bars_baby = engine.new_step_stream( | 39 bars_baby = engine.new_step_stream('bar\'s baby', allow_subannotations=True) |
40 'bar\'s baby', | 40 bars_baby.set_nest_level(1) |
41 allow_subannotations=True, | |
42 nest_level=1) | |
43 bars_baby.write_line('I\'m in bar\'s imagination!!') | 41 bars_baby.write_line('I\'m in bar\'s imagination!!') |
44 bars_baby.write_line('@@@STEP_WARNINGS@@@') | 42 bars_baby.write_line('@@@STEP_WARNINGS@@@') |
45 bars_baby.reset_subannotation_state() | 43 bars_baby.reset_subannotation_state() |
46 bars_baby.close() | 44 bars_baby.close() |
47 | 45 |
48 bar.set_build_property('is_babycrazy', 'true') | 46 bar.set_build_property('is_babycrazy', 'true') |
49 bar.write_line('bar tries to kiss foo, but foo already left') | 47 bar.write_line('bar tries to kiss foo, but foo already left') |
50 bar.write_line('@@@KISS@foo@@@') | 48 bar.write_line('@@@KISS@foo@@@') |
51 bar.set_step_status('EXCEPTION') | 49 bar.set_step_status('EXCEPTION') |
52 bar.close() | 50 bar.close() |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 | 157 |
160 def test_buildbot_status_constraint(self): | 158 def test_buildbot_status_constraint(self): |
161 with stream.StreamEngineInvariants() as engine: | 159 with stream.StreamEngineInvariants() as engine: |
162 foo = engine.new_step_stream('foo') | 160 foo = engine.new_step_stream('foo') |
163 foo.set_step_status('FAILURE') | 161 foo.set_step_status('FAILURE') |
164 with self.assertRaises(AssertionError): | 162 with self.assertRaises(AssertionError): |
165 foo.set_step_status('SUCCESS') | 163 foo.set_step_status('SUCCESS') |
166 | 164 |
167 if __name__ == '__main__': | 165 if __name__ == '__main__': |
168 unittest.main() | 166 unittest.main() |
OLD | NEW |