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

Side by Side Diff: scripts/slave/runtest.py

Issue 217053012: Make results_dashboard send just one request per test run. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: Group results into lists of limited length. Created 6 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 #!/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 """A tool to run a chrome test executable, used by the buildbot slaves. 6 """A tool to run a chrome test executable, used by the buildbot slaves.
7 7
8 When this is run, the current directory (cwd) should be the outer build 8 When this is run, the current directory (cwd) should be the outer build
9 directory (e.g., chrome-release/build/). 9 directory (e.g., chrome-release/build/).
10 10
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after
567 with file(supplemental_columns_file, 'r') as f: 567 with file(supplemental_columns_file, 'r') as f:
568 supplemental_columns = json.loads(f.read()) 568 supplemental_columns = json.loads(f.read())
569 return supplemental_columns 569 return supplemental_columns
570 570
571 571
572 def _SendResultsToDashboard(results_tracker, system, test, url, build_dir, 572 def _SendResultsToDashboard(results_tracker, system, test, url, build_dir,
573 mastername, buildername, buildnumber, 573 mastername, buildername, buildnumber,
574 supplemental_columns_file, extra_columns=None): 574 supplemental_columns_file, extra_columns=None):
575 """Sends results from a results tracker (aka log parser) to the dashboard. 575 """Sends results from a results tracker (aka log parser) to the dashboard.
576 576
577 TODO(qyearsley): Change this function and results_dashboard.SendResults so
578 that only one request is made per test run (instead of one per graph name).
579 Also, maybe refactor this function to take fewer arguments.
580
581 Args: 577 Args:
582 results_tracker: An instance of a log parser class, which has been used to 578 results_tracker: An instance of a log parser class, which has been used to
583 process the test output, so it contains the test results. 579 process the test output, so it contains the test results.
584 system: A string such as 'linux-release', which comes from perf_id. 580 system: A string such as 'linux-release', which comes from perf_id.
585 test: Test "suite" name string. 581 test: Test "suite" name string.
586 url: Dashboard URL. 582 url: Dashboard URL.
587 build_dir: Build dir name (used for cache file by results_dashboard). 583 build_dir: Build dir name (used for cache file by results_dashboard).
588 mastername: Buildbot master name, e.g. 'chromium.perf'. 584 mastername: Buildbot master name, e.g. 'chromium.perf'.
589 WARNING! This is incorrectly called "masterid" in some parts of the 585 WARNING! This is incorrectly called "masterid" in some parts of the
590 dashboard code. 586 dashboard code.
591 buildername: Builder name, e.g. 'Linux QA Perf (1)' 587 buildername: Builder name, e.g. 'Linux QA Perf (1)'
592 buildnumber: Build number (as a string). 588 buildnumber: Build number (as a string).
593 supplemental_columns_file: Filename for JSON supplemental columns file. 589 supplemental_columns_file: Filename for JSON supplemental columns file.
594 extra_columns: A dict of extra values to add to the supplemental columns 590 extra_columns: A dict of extra values to add to the supplemental columns
595 dict. 591 dict.
596 """ 592 """
597 if system is None: 593 if system is None:
598 # perf_id not specified in factory-properties 594 # perf_id not specified in factory-properties
599 return 595 return
600 supplemental_columns = _GetSupplementalColumns(build_dir, 596 supplemental_columns = _GetSupplementalColumns(build_dir,
601 supplemental_columns_file) 597 supplemental_columns_file)
602 if extra_columns: 598 if extra_columns:
603 supplemental_columns.update(extra_columns) 599 supplemental_columns.update(extra_columns)
604 for logname, log in results_tracker.PerformanceLogs().iteritems(): 600
605 lines = [str(l).rstrip() for l in log] 601 logs_dict = results_tracker.PerformanceLogs()
606 try: 602 results_dashboard.SendResults(logs_dict, system, test, url, mastername,
607 results_dashboard.SendResults(logname, lines, system, test, url, 603 buildername, buildername, buildnumber,
608 mastername, buildername, buildnumber, 604 build_dir, supplemental_columns)
609 build_dir, supplemental_columns)
610 except NotImplementedError as e:
611 print 'Did not submit to results dashboard: %s' % e
612 605
613 606
614 def _BuildCoverageGtestExclusions(options, args): 607 def _BuildCoverageGtestExclusions(options, args):
615 gtest_exclusions = { 608 gtest_exclusions = {
616 'win32': { 609 'win32': {
617 'browser_tests': ( 610 'browser_tests': (
618 'ChromeNotifierDelegateBrowserTest.ClickTest', 611 'ChromeNotifierDelegateBrowserTest.ClickTest',
619 'ChromeNotifierDelegateBrowserTest.ButtonClickTest', 612 'ChromeNotifierDelegateBrowserTest.ButtonClickTest',
620 'SyncFileSystemApiTest.GetFileStatuses', 613 'SyncFileSystemApiTest.GetFileStatuses',
621 'SyncFileSystemApiTest.WriteFileThenGetUsage', 614 'SyncFileSystemApiTest.WriteFileThenGetUsage',
(...skipping 1119 matching lines...) Expand 10 before | Expand all | Expand 10 after
1741 finally: 1734 finally:
1742 if did_launch_dbus: 1735 if did_launch_dbus:
1743 # It looks like the command line argument --exit-with-session 1736 # It looks like the command line argument --exit-with-session
1744 # isn't working to clean up the spawned dbus-daemon. Kill it 1737 # isn't working to clean up the spawned dbus-daemon. Kill it
1745 # manually. 1738 # manually.
1746 _ShutdownDBus() 1739 _ShutdownDBus()
1747 1740
1748 1741
1749 if '__main__' == __name__: 1742 if '__main__' == __name__:
1750 sys.exit(main()) 1743 sys.exit(main())
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698