Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(283)

Side by Side Diff: tools/isolate/isolate_smoke_test.py

Issue 10386211: An empty .results file would throw ValueError, eat it. (Closed) Base URL: bombe.local:src/chrome/src@11_fix_handling_gypv8sh
Patch Set: Update integration test Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tools/isolate/isolate.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import cStringIO 6 import cStringIO
7 import hashlib 7 import hashlib
8 import json 8 import json
9 import logging 9 import logging
10 import os 10 import os
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 self.fail() 471 self.fail()
472 except subprocess.CalledProcessError, e: 472 except subprocess.CalledProcessError, e:
473 out = e.output 473 out = e.output
474 self._expect_no_tree() 474 self._expect_no_tree()
475 self._expect_results(['fail.py'], None, None) 475 self._expect_results(['fail.py'], None, None)
476 expected = 'Failing' 476 expected = 'Failing'
477 if sys.platform == 'win32': 477 if sys.platform == 'win32':
478 # Includes spew from tracerpt.exe. 478 # Includes spew from tracerpt.exe.
479 self.assertTrue(out.startswith(expected)) 479 self.assertTrue(out.startswith(expected))
480 else: 480 else:
481 self.assertEquals(expected, out.rstrip()) 481 lines = out.strip().splitlines()
482 self.assertEquals(3, len(lines))
483 self.assertTrue(lines[0].startswith('WARNING'))
484 self.assertTrue(lines[1].startswith('WARNING'))
485 self.assertEquals(expected, lines[2])
482 486
483 def test_missing_trailing_slash(self): 487 def test_missing_trailing_slash(self):
484 try: 488 try:
485 self._execute('trace', 'missing_trailing_slash.isolate', [], True) 489 self._execute('trace', 'missing_trailing_slash.isolate', [], True)
486 self.fail() 490 self.fail()
487 except subprocess.CalledProcessError, e: 491 except subprocess.CalledProcessError, e:
488 out = e.output 492 out = e.output
489 self._expect_no_tree() 493 self._expect_no_tree()
490 self._expect_no_result() 494 self._expect_no_result()
491 expected = ( 495 expected = (
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
699 # Clean the directory from the logs, which are OS-specific. 703 # Clean the directory from the logs, which are OS-specific.
700 isolate.trace_inputs.get_api().clean_trace( 704 isolate.trace_inputs.get_api().clean_trace(
701 os.path.join(self.tempdir, 'isolate_smoke_test.results.log')) 705 os.path.join(self.tempdir, 'isolate_smoke_test.results.log'))
702 self.assertEquals(files, list_files_tree(self.tempdir)) 706 self.assertEquals(files, list_files_tree(self.tempdir))
703 707
704 708
705 if __name__ == '__main__': 709 if __name__ == '__main__':
706 VERBOSE = '-v' in sys.argv 710 VERBOSE = '-v' in sys.argv
707 logging.basicConfig(level=logging.DEBUG if VERBOSE else logging.ERROR) 711 logging.basicConfig(level=logging.DEBUG if VERBOSE else logging.ERROR)
708 unittest.main() 712 unittest.main()
OLDNEW
« no previous file with comments | « tools/isolate/isolate.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698