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

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

Issue 219773006: Revert of Make results_dashboard send just one request per test run. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: 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
« no previous file with comments | « scripts/slave/results_dashboard.py ('k') | scripts/slave/unittests/results_dashboard_test.py » ('j') | 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 """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
577 Args: 581 Args:
578 results_tracker: An instance of a log parser class, which has been used to 582 results_tracker: An instance of a log parser class, which has been used to
579 process the test output, so it contains the test results. 583 process the test output, so it contains the test results.
580 system: A string such as 'linux-release', which comes from perf_id. 584 system: A string such as 'linux-release', which comes from perf_id.
581 test: Test "suite" name string. 585 test: Test "suite" name string.
582 url: Dashboard URL. 586 url: Dashboard URL.
583 build_dir: Build dir name (used for cache file by results_dashboard). 587 build_dir: Build dir name (used for cache file by results_dashboard).
584 mastername: Buildbot master name, e.g. 'chromium.perf'. 588 mastername: Buildbot master name, e.g. 'chromium.perf'.
585 WARNING! This is incorrectly called "masterid" in some parts of the 589 WARNING! This is incorrectly called "masterid" in some parts of the
586 dashboard code. 590 dashboard code.
587 buildername: Builder name, e.g. 'Linux QA Perf (1)' 591 buildername: Builder name, e.g. 'Linux QA Perf (1)'
588 buildnumber: Build number (as a string). 592 buildnumber: Build number (as a string).
589 supplemental_columns_file: Filename for JSON supplemental columns file. 593 supplemental_columns_file: Filename for JSON supplemental columns file.
590 extra_columns: A dict of extra values to add to the supplemental columns 594 extra_columns: A dict of extra values to add to the supplemental columns
591 dict. 595 dict.
592 """ 596 """
593 if system is None: 597 if system is None:
594 # perf_id not specified in factory-properties 598 # perf_id not specified in factory-properties
595 return 599 return
596 supplemental_columns = _GetSupplementalColumns(build_dir, 600 supplemental_columns = _GetSupplementalColumns(build_dir,
597 supplemental_columns_file) 601 supplemental_columns_file)
598 if extra_columns: 602 if extra_columns:
599 supplemental_columns.update(extra_columns) 603 supplemental_columns.update(extra_columns)
600 604 for logname, log in results_tracker.PerformanceLogs().iteritems():
601 logs_dict = results_tracker.PerformanceLogs() 605 lines = [str(l).rstrip() for l in log]
602 results_dashboard.SendResults(logs_dict, system, test, url, mastername, 606 try:
603 buildername, buildername, buildnumber, 607 results_dashboard.SendResults(logname, lines, system, test, url,
604 build_dir, supplemental_columns) 608 mastername, buildername, buildnumber,
609 build_dir, supplemental_columns)
610 except NotImplementedError as e:
611 print 'Did not submit to results dashboard: %s' % e
605 612
606 613
607 def _BuildCoverageGtestExclusions(options, args): 614 def _BuildCoverageGtestExclusions(options, args):
608 gtest_exclusions = { 615 gtest_exclusions = {
609 'win32': { 616 'win32': {
610 'browser_tests': ( 617 'browser_tests': (
611 'ChromeNotifierDelegateBrowserTest.ClickTest', 618 'ChromeNotifierDelegateBrowserTest.ClickTest',
612 'ChromeNotifierDelegateBrowserTest.ButtonClickTest', 619 'ChromeNotifierDelegateBrowserTest.ButtonClickTest',
613 'SyncFileSystemApiTest.GetFileStatuses', 620 'SyncFileSystemApiTest.GetFileStatuses',
614 'SyncFileSystemApiTest.WriteFileThenGetUsage', 621 'SyncFileSystemApiTest.WriteFileThenGetUsage',
(...skipping 1119 matching lines...) Expand 10 before | Expand all | Expand 10 after
1734 finally: 1741 finally:
1735 if did_launch_dbus: 1742 if did_launch_dbus:
1736 # It looks like the command line argument --exit-with-session 1743 # It looks like the command line argument --exit-with-session
1737 # isn't working to clean up the spawned dbus-daemon. Kill it 1744 # isn't working to clean up the spawned dbus-daemon. Kill it
1738 # manually. 1745 # manually.
1739 _ShutdownDBus() 1746 _ShutdownDBus()
1740 1747
1741 1748
1742 if '__main__' == __name__: 1749 if '__main__' == __name__:
1743 sys.exit(main()) 1750 sys.exit(main())
OLDNEW
« no previous file with comments | « scripts/slave/results_dashboard.py ('k') | scripts/slave/unittests/results_dashboard_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698