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

Unified Diff: server/autotest.py

Issue 1317002: Continue to refactor autoserv to build client test at run time. (Closed)
Patch Set: path 18 Created 10 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « global_config.ini ('k') | server/prebuild.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: server/autotest.py
diff --git a/server/autotest.py b/server/autotest.py
index c35f4a1ed1e3b695ef4218170d0466df5d7d5d81..70d35556b168199a98769fc00285a71d2fb5de2f 100644
--- a/server/autotest.py
+++ b/server/autotest.py
@@ -2,7 +2,7 @@
import re, os, sys, traceback, subprocess, time, pickle, glob, tempfile
import logging, getpass
-from autotest_lib.server import installable_object, utils
+from autotest_lib.server import installable_object, prebuild, utils
from autotest_lib.client.common_lib import log, error, autotemp
from autotest_lib.client.common_lib import global_config, packages
from autotest_lib.client.common_lib import utils as client_utils
@@ -16,6 +16,11 @@ BOOT_TIME = 1800
CRASH_RECOVERY_TIME = 9000
+get_value = global_config.global_config.get_config_value
+autoserv_prebuild = get_value('AUTOSERV', 'enable_server_prebuild',
+ type=bool, default=False)
+
+
class AutodirNotFoundError(Exception):
"""No Autotest installation could be found."""
@@ -971,10 +976,17 @@ class client_logger(object):
name, pkg_type = self.job.pkgmgr.parse_tarball_name(pkg_name)
src_dirs = []
if pkg_type == 'test':
- src_dirs += [os.path.join(self.job.clientdir, 'site_tests', name),
- os.path.join(self.job.clientdir, 'tests', name)]
+ for test_dir in ['site_tests', 'tests']:
+ src_dir = os.path.join(self.job.clientdir, test_dir, name)
+ if os.path.exists(src_dir):
+ src_dirs += [src_dir]
+ if autoserv_prebuild:
+ prebuild.setup(self.job.clientdir, src_dir)
+ break
elif pkg_type == 'profiler':
src_dirs += [os.path.join(self.job.clientdir, 'profilers', name)]
+ if autoserv_prebuild:
+ prebuild.setup(self.job.clientdir, src_dir)
elif pkg_type == 'dep':
src_dirs += [os.path.join(self.job.clientdir, 'deps', name)]
elif pkg_type == 'client':
« no previous file with comments | « global_config.ini ('k') | server/prebuild.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698