Commit 5bf0ad43 authored by Ben Pastene's avatar Ben Pastene Committed by Commit Bot

Apply env var modifications for every type of cros VM test.

This is needed for both sanity test and tast tests, so this applies
the env var changes for every type of test. Normal GTest tests don't
need it, but they'll get it anyway. Shouldn't be harmful.

Change-Id: Ida2bd856fc75a089f899c4e4cfdc56de90d5fa48
Reviewed-on: https://chromium-review.googlesource.com/1244876Reviewed-by: default avatarJohn Budorick <jbudorick@chromium.org>
Commit-Queue: Ben Pastene <bpastene@chromium.org>
Cr-Commit-Position: refs/heads/master@{#594146}
parent db8ed165
...@@ -52,7 +52,6 @@ class RemoteTest(object): ...@@ -52,7 +52,6 @@ class RemoteTest(object):
self._test_launcher_summary_output = args.test_launcher_summary_output self._test_launcher_summary_output = args.test_launcher_summary_output
self._vm_logs_dir = args.vm_logs_dir self._vm_logs_dir = args.vm_logs_dir
self._test_env = os.environ.copy()
self._retries = 0 self._retries = 0
self._timeout = None self._timeout = None
...@@ -68,6 +67,19 @@ class RemoteTest(object): ...@@ -68,6 +67,19 @@ class RemoteTest(object):
'--results-dest-dir', args.vm_logs_dir, '--results-dest-dir', args.vm_logs_dir,
] ]
self._test_env = os.environ.copy()
# deploy_chrome needs a set of GN args used to build chrome to determine if
# certain libraries need to be pushed to the VM. It looks for the args via
# an env var. To trigger the default deploying behavior, give it a dummy set
# of args.
# TODO(crbug.com/823996): Make the GN-dependent deps controllable via cmd
# line args.
if not self._test_env.get('GN_ARGS'):
self._test_env['GN_ARGS'] = 'is_chromeos = true'
if not self._test_env.get('USE'):
self._test_env['USE'] = 'highdpi'
self._test_env['PATH'] = (
self._test_env['PATH'] + ':' + os.path.join(CHROMITE_PATH, 'bin'))
@property @property
def suite_name(self): def suite_name(self):
raise NotImplementedError('Child classes need to define suite name.') raise NotImplementedError('Child classes need to define suite name.')
...@@ -356,19 +368,6 @@ class BrowserSanityTest(RemoteTest): ...@@ -356,19 +368,6 @@ class BrowserSanityTest(RemoteTest):
'--build-dir', os.path.relpath(self._path_to_outdir, CHROMIUM_SRC_PATH), '--build-dir', os.path.relpath(self._path_to_outdir, CHROMIUM_SRC_PATH),
] ]
# deploy_chrome needs a set of GN args used to build chrome to determine if
# certain libraries need to be pushed to the VM. It looks for the args via
# an env var. To trigger the default deploying behavior, give it a dummy set
# of args.
# TODO(crbug.com/823996): Make the GN-dependent deps controllable via cmd
# line args.
if not self._test_env.get('GN_ARGS'):
self._test_env['GN_ARGS'] = 'is_chromeos = true'
if not self._test_env.get('USE'):
self._test_env['USE'] = 'highdpi'
self._test_env['PATH'] = (
self._test_env['PATH'] + ':' + os.path.join(CHROMITE_PATH, 'bin'))
def vm_test(args, unknown_args): def vm_test(args, unknown_args):
# cros_run_vm_test has trouble with relative paths that go up directories, # cros_run_vm_test has trouble with relative paths that go up directories,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment