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

Side by Side Diff: sky/tools/webkitpy/layout_tests/port/base.py

Issue 679303002: Make test_sky work on machines with fewer than 4 CPUs. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 | « no previous file | 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 # Copyright (C) 2010 Google Inc. All rights reserved. 1 # Copyright (C) 2010 Google Inc. All rights reserved.
2 # 2 #
3 # Redistribution and use in source and binary forms, with or without 3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions are 4 # modification, are permitted provided that the following conditions are
5 # met: 5 # met:
6 # 6 #
7 # * Redistributions of source code must retain the above copyright 7 # * Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer. 8 # notice, this list of conditions and the following disclaimer.
9 # * Redistributions in binary form must reproduce the above 9 # * Redistributions in binary form must reproduce the above
10 # copyright notice, this list of conditions and the following disclaimer 10 # copyright notice, this list of conditions and the following disclaimer
(...skipping 19 matching lines...) Expand all
30 test infrastructure (the Port and Driver classes).""" 30 test infrastructure (the Port and Driver classes)."""
31 31
32 import cgi 32 import cgi
33 import difflib 33 import difflib
34 import errno 34 import errno
35 import itertools 35 import itertools
36 import logging 36 import logging
37 import os 37 import os
38 import operator 38 import operator
39 import optparse 39 import optparse
40 import math
40 import re 41 import re
41 import sys 42 import sys
42 43
43 try: 44 try:
44 from collections import OrderedDict 45 from collections import OrderedDict
45 except ImportError: 46 except ImportError:
46 # Needed for Python < 2.7 47 # Needed for Python < 2.7
47 from webkitpy.thirdparty.ordered_dict import OrderedDict 48 from webkitpy.thirdparty.ordered_dict import OrderedDict
48 49
49 50
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 def pretty_patch_available(self): 264 def pretty_patch_available(self):
264 if self._pretty_patch_available is None: 265 if self._pretty_patch_available is None:
265 self._pretty_patch_available = self.check_pretty_patch(logging=False ) 266 self._pretty_patch_available = self.check_pretty_patch(logging=False )
266 return self._pretty_patch_available 267 return self._pretty_patch_available
267 268
268 def default_child_processes(self): 269 def default_child_processes(self):
269 """Return the number of drivers to use for this port.""" 270 """Return the number of drivers to use for this port."""
270 # FIXME: See if we can reduce the denominator here without causing timeo uts. 271 # FIXME: See if we can reduce the denominator here without causing timeo uts.
271 # Maybe we need to run one sky_shell process and multiple sky_viewers 272 # Maybe we need to run one sky_shell process and multiple sky_viewers
272 # instead of multiple sky_shells 273 # instead of multiple sky_shells
273 return int(self._executive.cpu_count() / 4) 274 return int(math.ceil(float(self._executive.cpu_count()) / 4))
274 275
275 def default_max_locked_shards(self): 276 def default_max_locked_shards(self):
276 """Return the number of "locked" shards to run in parallel (like the htt p tests).""" 277 """Return the number of "locked" shards to run in parallel (like the htt p tests)."""
277 return self.default_child_processes() 278 return self.default_child_processes()
278 279
279 def baseline_path(self): 280 def baseline_path(self):
280 """Return the absolute path to the directory to store new baselines in f or this port.""" 281 """Return the absolute path to the directory to store new baselines in f or this port."""
281 # FIXME: remove once all callers are calling either baseline_version_dir () or baseline_platform_dir() 282 # FIXME: remove once all callers are calling either baseline_version_dir () or baseline_platform_dir()
282 return self.baseline_version_dir() 283 return self.baseline_version_dir()
283 284
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
712 return reftest_list.get(self._filesystem.join(self.layout_tests_dir(), t est_name), []) # pylint: disable=E1103 713 return reftest_list.get(self._filesystem.join(self.layout_tests_dir(), t est_name), []) # pylint: disable=E1103
713 714
714 def tests(self, paths): 715 def tests(self, paths):
715 """Return the list of tests found matching paths.""" 716 """Return the list of tests found matching paths."""
716 tests = self._real_tests(paths) 717 tests = self._real_tests(paths)
717 tests.extend(self._virtual_tests(paths, self.populated_virtual_test_suit es())) 718 tests.extend(self._virtual_tests(paths, self.populated_virtual_test_suit es()))
718 return tests 719 return tests
719 720
720 def _real_tests(self, paths): 721 def _real_tests(self, paths):
721 # When collecting test cases, skip these directories 722 # When collecting test cases, skip these directories
722 skipped_directories = set(['.svn', '_svn', 'platform', 'resources', 'sup port', 'script-tests', 'reference', 'reftest']) 723 skipped_directories = set(['.svn', '_svn', 'platform', 'resources', 'sup port', 'script-tests', 'reference', 'reftest', 'conf'])
723 files = find_files.find(self._filesystem, self.layout_tests_dir(), paths , skipped_directories, Port.is_test_file, self.test_key) 724 files = find_files.find(self._filesystem, self.layout_tests_dir(), paths , skipped_directories, Port.is_test_file, self.test_key)
724 return [self.relative_test_filename(f) for f in files] 725 return [self.relative_test_filename(f) for f in files]
725 726
726 # When collecting test cases, we include any file with these extensions. 727 # When collecting test cases, we include any file with these extensions.
727 _supported_file_extensions = set(['.html', '.xml', '.xhtml', '.xht', '.pl', 728 _supported_file_extensions = set(['.html'])
728 '.htm', '.php', '.svg', '.mht', '.pdf'])
729 729
730 @staticmethod 730 @staticmethod
731 # If any changes are made here be sure to update the isUsedInReftest method in old-run-webkit-tests as well. 731 # If any changes are made here be sure to update the isUsedInReftest method in old-run-webkit-tests as well.
732 def is_reference_html_file(filesystem, dirname, filename): 732 def is_reference_html_file(filesystem, dirname, filename):
733 if filename.startswith('ref-') or filename.startswith('notref-'): 733 if filename.startswith('ref-') or filename.startswith('notref-'):
734 return True 734 return True
735 filename_wihout_ext, unused = filesystem.splitext(filename) 735 filename_wihout_ext, unused = filesystem.splitext(filename)
736 for suffix in ['-expected', '-expected-mismatch', '-ref', '-notref']: 736 for suffix in ['-expected', '-expected-mismatch', '-ref', '-notref']:
737 if filename_wihout_ext.endswith(suffix): 737 if filename_wihout_ext.endswith(suffix):
738 return True 738 return True
(...skipping 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after
1760 1760
1761 class PhysicalTestSuite(object): 1761 class PhysicalTestSuite(object):
1762 def __init__(self, base, args): 1762 def __init__(self, base, args):
1763 self.name = base 1763 self.name = base
1764 self.base = base 1764 self.base = base
1765 self.args = args 1765 self.args = args
1766 self.tests = set() 1766 self.tests = set()
1767 1767
1768 def __repr__(self): 1768 def __repr__(self):
1769 return "PhysicalTestSuite('%s', '%s', %s)" % (self.name, self.base, self .args) 1769 return "PhysicalTestSuite('%s', '%s', %s)" % (self.name, self.base, self .args)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698