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

Side by Side Diff: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py

Issue 2821543003: In run-webkit-tests, start xvfb if necessary. (Closed)
Patch Set: Check process after starting, wait after killing, change stderr redirect to DEVNULL Created 3 years, 8 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
OLDNEW
1 # Copyright (C) 2010 Google Inc. All rights reserved. 1 # Copyright (C) 2010 Google Inc. All rights reserved.
2 # Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Sze ged 2 # Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Sze ged
3 # 3 #
4 # Redistribution and use in source and binary forms, with or without 4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions are 5 # modification, are permitted provided that the following conditions are
6 # met: 6 # met:
7 # 7 #
8 # * Redistributions of source code must retain the above copyright 8 # * Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer. 9 # notice, this list of conditions and the following disclaimer.
10 # * Redistributions in binary form must reproduce the above 10 # * Redistributions in binary form must reproduce the above
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 results_directories = [] 318 results_directories = []
319 for dir in file_list: 319 for dir in file_list:
320 file_path = self._filesystem.join(results_directory_path, dir) 320 file_path = self._filesystem.join(results_directory_path, dir)
321 if self._filesystem.isdir(file_path) and self._results_directory in file_path: 321 if self._filesystem.isdir(file_path) and self._results_directory in file_path:
322 results_directories.append(file_path) 322 results_directories.append(file_path)
323 results_directories.sort(key=lambda x: self._filesystem.mtime(x)) 323 results_directories.sort(key=lambda x: self._filesystem.mtime(x))
324 self._printer.write_update("Clobbering excess archived results in %s" % results_directory_path) 324 self._printer.write_update("Clobbering excess archived results in %s" % results_directory_path)
325 self._delete_dirs(results_directories[:-self.ARCHIVED_RESULTS_LIMIT]) 325 self._delete_dirs(results_directories[:-self.ARCHIVED_RESULTS_LIMIT])
326 326
327 def _set_up_run(self, test_names): 327 def _set_up_run(self, test_names):
328 exit_code = self._port.setup_test_run()
329
328 self._printer.write_update("Checking build ...") 330 self._printer.write_update("Checking build ...")
329 if self._options.build: 331 if self._options.build:
330 exit_code = self._port.check_build(self._needs_servers(test_names), self._printer) 332 exit_code = self._port.check_build(self._needs_servers(test_names), self._printer)
331 if exit_code: 333 if exit_code:
332 _log.error("Build check failed") 334 _log.error("Build check failed")
333 return exit_code 335 return exit_code
334 336
335 # Check that the system dependencies (themes, fonts, ...) are correct.
336 if not self._options.nocheck_sys_deps:
337 self._printer.write_update("Checking system dependencies ...")
338 exit_code = self._port.check_sys_deps(self._needs_servers(test_names ))
339 if exit_code:
340 return exit_code
341
342 if self._options.clobber_old_results: 337 if self._options.clobber_old_results:
343 self._clobber_old_results() 338 self._clobber_old_results()
344 elif self._filesystem.exists(self._results_directory): 339 elif self._filesystem.exists(self._results_directory):
345 self._limit_archived_results_count() 340 self._limit_archived_results_count()
346 # Rename the existing results folder for archiving. 341 # Rename the existing results folder for archiving.
347 self._rename_results_folder() 342 self._rename_results_folder()
348 343
349 # Create the output directory if it doesn't already exist. 344 # Create the output directory if it doesn't already exist.
350 self._port.host.filesystem.maybe_make_directory(self._results_directory) 345 self._port.host.filesystem.maybe_make_directory(self._results_directory)
351 346
352 self._port.setup_test_run() 347 # Check that the system dependencies (themes, fonts, ...) are correct.
348 if not self._options.nocheck_sys_deps:
349 self._printer.write_update("Checking system dependencies ...")
350 exit_code = self._port.check_sys_deps(self._needs_servers(test_names ))
351 if exit_code:
352 return exit_code
353
353 return exit_codes.OK_EXIT_STATUS 354 return exit_codes.OK_EXIT_STATUS
354 355
355 def _run_tests(self, tests_to_run, tests_to_skip, repeat_each, iterations, 356 def _run_tests(self, tests_to_run, tests_to_skip, repeat_each, iterations,
356 num_workers, retry_attempt=0): 357 num_workers, retry_attempt=0):
357 358
358 test_inputs = [] 359 test_inputs = []
359 for _ in xrange(iterations): 360 for _ in xrange(iterations):
360 for test in tests_to_run: 361 for test in tests_to_run:
361 for _ in xrange(repeat_each): 362 for _ in xrange(repeat_each):
362 test_inputs.append(self._test_input_for_file(test)) 363 test_inputs.append(self._test_input_for_file(test))
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 550
550 stats = {} 551 stats = {}
551 for result in initial_results.results_by_name.values(): 552 for result in initial_results.results_by_name.values():
552 if result.type != test_expectations.SKIP: 553 if result.type != test_expectations.SKIP:
553 stats[result.test_name] = {'results': (_worker_number(result.wor ker_name), result.test_number, result.pid, int( 554 stats[result.test_name] = {'results': (_worker_number(result.wor ker_name), result.test_number, result.pid, int(
554 result.test_run_time * 1000), int(result.total_run_time * 10 00))} 555 result.test_run_time * 1000), int(result.total_run_time * 10 00))}
555 stats_trie = {} 556 stats_trie = {}
556 for name, value in stats.iteritems(): 557 for name, value in stats.iteritems():
557 json_results_generator.add_path_to_trie(name, value, stats_trie) 558 json_results_generator.add_path_to_trie(name, value, stats_trie)
558 return stats_trie 559 return stats_trie
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698