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

Side by Side Diff: tools/testrunner/network/network_execution.py

Issue 1168303007: [test] Refactoring - Let runner handle test IDs. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 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/testrunner/local/execution.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 # Copyright 2012 the V8 project authors. All rights reserved. 1 # Copyright 2012 the V8 project authors. All rights reserved.
2 # Redistribution and use in source and binary forms, with or without 2 # Redistribution and use in source and binary forms, with or without
3 # modification, are permitted provided that the following conditions are 3 # modification, are permitted provided that the following conditions are
4 # met: 4 # met:
5 # 5 #
6 # * Redistributions of source code must retain the above copyright 6 # * Redistributions of source code must retain the above copyright
7 # notice, this list of conditions and the following disclaimer. 7 # notice, this list of conditions and the following disclaimer.
8 # * Redistributions in binary form must reproduce the above 8 # * Redistributions in binary form must reproduce the above
9 # copyright notice, this list of conditions and the following 9 # copyright notice, this list of conditions and the following
10 # disclaimer in the documentation and/or other materials provided 10 # disclaimer in the documentation and/or other materials provided
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 45
46 def GetPeers(): 46 def GetPeers():
47 data = local_handler.LocalQuery([constants.REQUEST_PEERS]) 47 data = local_handler.LocalQuery([constants.REQUEST_PEERS])
48 if not data: return [] 48 if not data: return []
49 return [ peer.Peer.Unpack(p) for p in data ] 49 return [ peer.Peer.Unpack(p) for p in data ]
50 50
51 51
52 class NetworkedRunner(execution.Runner): 52 class NetworkedRunner(execution.Runner):
53 def __init__(self, suites, progress_indicator, context, peers, workspace): 53 def __init__(self, suites, progress_indicator, context, peers, workspace):
54 self.suites = suites 54 self.suites = suites
55 num_tests = 0
56 datapath = os.path.join("out", "testrunner_data") 55 datapath = os.path.join("out", "testrunner_data")
57 # TODO(machenbach): These fields should exist now in the superclass. 56 # TODO(machenbach): These fields should exist now in the superclass.
58 # But there is no super constructor call. Check if this is a problem. 57 # But there is no super constructor call. Check if this is a problem.
59 self.perf_data_manager = perfdata.PerfDataManager(datapath) 58 self.perf_data_manager = perfdata.PerfDataManager(datapath)
60 self.perfdata = self.perf_data_manager.GetStore(context.arch, context.mode) 59 self.perfdata = self.perf_data_manager.GetStore(context.arch, context.mode)
61 for s in suites: 60 for s in suites:
62 for t in s.tests: 61 for t in s.tests:
63 t.duration = self.perfdata.FetchPerfData(t) or 1.0 62 t.duration = self.perfdata.FetchPerfData(t) or 1.0
64 num_tests += len(s.tests) 63 self._CommonInit(suites, progress_indicator, context)
65 self._CommonInit(num_tests, progress_indicator, context)
66 self.tests = [] # Only used if we need to fall back to local execution. 64 self.tests = [] # Only used if we need to fall back to local execution.
67 self.tests_lock = threading.Lock() 65 self.tests_lock = threading.Lock()
68 self.peers = peers 66 self.peers = peers
69 self.pubkey_fingerprint = None # Fetched later. 67 self.pubkey_fingerprint = None # Fetched later.
70 self.base_rev = subprocess.check_output( 68 self.base_rev = subprocess.check_output(
71 "cd %s; git log -1 --format=%%H --grep=git-svn-id" % workspace, 69 "cd %s; git log -1 --format=%%H --grep=git-svn-id" % workspace,
72 shell=True).strip() 70 shell=True).strip()
73 self.base_svn_rev = subprocess.check_output( 71 self.base_svn_rev = subprocess.check_output(
74 "cd %s; git log -1 %s" # Get commit description. 72 "cd %s; git log -1 %s" # Get commit description.
75 " | grep -e '^\s*git-svn-id:'" # Extract "git-svn-id" line. 73 " | grep -e '^\s*git-svn-id:'" # Extract "git-svn-id" line.
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 total_work += p.assigned_work 245 total_work += p.assigned_work
248 for p in self.peers: 246 for p in self.peers:
249 p.assigned_work /= total_work 247 p.assigned_work /= total_work
250 p.runtime /= total_runtime 248 p.runtime /= total_runtime
251 perf_correction = p.assigned_work / p.runtime 249 perf_correction = p.assigned_work / p.runtime
252 old_perf = p.relative_performance 250 old_perf = p.relative_performance
253 p.relative_performance = (old_perf + perf_correction) / 2.0 251 p.relative_performance = (old_perf + perf_correction) / 2.0
254 compression.Send([constants.UPDATE_PERF, p.address, 252 compression.Send([constants.UPDATE_PERF, p.address,
255 p.relative_performance], 253 p.relative_performance],
256 self.local_socket) 254 self.local_socket)
OLDNEW
« no previous file with comments | « tools/testrunner/local/execution.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698