Commit 033f3af0 authored by grt's avatar grt Committed by Commit bot

Temporarily stop launching Chrome in installer test runs.

The bot runner dies sometimes when running this test. Disable the part
of the test that launches Chrome to see if that makes the failures go
away. This change also makes the logs a bit more informative by added
date, time, file, and line info in the same format as Chrome's logging.
It also enables verbose logging for Chrome's installer.

BUG=402081
NOTRY=true
TBR=gab@chromium.org

Review URL: https://codereview.chromium.org/545373004

Cr-Commit-Position: refs/heads/master@{#294180}
parent 4faed13c
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
"values": { "values": {
"UninstallString": { "UninstallString": {
"type": "SZ", "type": "SZ",
"data": "\"$PROGRAM_FILES\\$CHROME_DIR\\Application\\$MINI_INSTALLER_FILE_VERSION\\Installer\\setup.exe\" --uninstall --multi-install --chrome --system-level" "data": "\"$PROGRAM_FILES\\$CHROME_DIR\\Application\\$MINI_INSTALLER_FILE_VERSION\\Installer\\setup.exe\" --uninstall --multi-install --chrome --system-level --verbose-logging"
}, },
"Version": {"type": "SZ", "data": "$MINI_INSTALLER_FILE_VERSION"} "Version": {"type": "SZ", "data": "$MINI_INSTALLER_FILE_VERSION"}
} }
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
"values": { "values": {
"UninstallString": { "UninstallString": {
"type": "SZ", "type": "SZ",
"data": "\"$LOCAL_APPDATA\\$CHROME_DIR\\Application\\$MINI_INSTALLER_FILE_VERSION\\Installer\\setup.exe\" --uninstall --multi-install --chrome" "data": "\"$LOCAL_APPDATA\\$CHROME_DIR\\Application\\$MINI_INSTALLER_FILE_VERSION\\Installer\\setup.exe\" --uninstall --multi-install --chrome --verbose-logging"
}, },
"Version": {"type": "SZ", "data": "$MINI_INSTALLER_FILE_VERSION"} "Version": {"type": "SZ", "data": "$MINI_INSTALLER_FILE_VERSION"}
} }
......
...@@ -25,9 +25,9 @@ ...@@ -25,9 +25,9 @@
], ],
"actions": [ "actions": [
["install_chrome_user", ["install_chrome_user",
"\"$MINI_INSTALLER\" --chrome --multi-install --do-not-launch-chrome"], "\"$MINI_INSTALLER\" --chrome --multi-install --verbose-logging --do-not-launch-chrome"],
["install_chrome_system", ["install_chrome_system",
"\"$MINI_INSTALLER\" --chrome --multi-install --system-level --do-not-launch-chrome"], "\"$MINI_INSTALLER\" --chrome --multi-install --verbose-logging --system-level --do-not-launch-chrome"],
["launch_chrome_user", ["launch_chrome_user",
"python launch_chrome.py \"$LOCAL_APPDATA\\$CHROME_DIR\\Application\\chrome.exe\""], "python launch_chrome.py \"$LOCAL_APPDATA\\$CHROME_DIR\\Application\\chrome.exe\""],
["launch_chrome_system", ["launch_chrome_system",
...@@ -47,8 +47,6 @@ ...@@ -47,8 +47,6 @@
"traversal": [ "traversal": [
"no_pv", "no_pv",
"install_chrome_user", "chrome_user_installed_not_inuse", "install_chrome_user", "chrome_user_installed_not_inuse",
"launch_chrome_user", "chrome_user_installed_inuse",
"quit_chrome_user", "chrome_user_installed_not_inuse",
"uninstall_chrome_user", "clean" "uninstall_chrome_user", "clean"
] ]
}, },
...@@ -57,8 +55,6 @@ ...@@ -57,8 +55,6 @@
"traversal": [ "traversal": [
"no_pv", "no_pv",
"install_chrome_system", "chrome_system_installed_not_inuse", "install_chrome_system", "chrome_system_installed_not_inuse",
"launch_chrome_system", "chrome_system_installed_inuse",
"quit_chrome_system", "chrome_system_installed_not_inuse",
"uninstall_chrome_system", "clean" "uninstall_chrome_system", "clean"
] ]
} }
......
...@@ -69,7 +69,8 @@ def QuitChrome(chrome_path): ...@@ -69,7 +69,8 @@ def QuitChrome(chrome_path):
""" """
if not CloseWindows(chrome_path): if not CloseWindows(chrome_path):
# TODO(robertshield): Investigate why Chrome occasionally doesn't shut down. # TODO(robertshield): Investigate why Chrome occasionally doesn't shut down.
print 'Warning: Chrome not responding to window closure. Killing process...' sys.stderr.write('Warning: Chrome not responding to window closure. '
'Killing all processes belonging to %s\n' % chrome_path)
KillNamedProcess(chrome_path) KillNamedProcess(chrome_path)
......
...@@ -10,6 +10,8 @@ the design documentation at http://goo.gl/Q0rGM6 ...@@ -10,6 +10,8 @@ the design documentation at http://goo.gl/Q0rGM6
""" """
import argparse import argparse
import datetime
import inspect
import json import json
import os import os
import subprocess import subprocess
...@@ -22,6 +24,20 @@ from variable_expander import VariableExpander ...@@ -22,6 +24,20 @@ from variable_expander import VariableExpander
import verifier_runner import verifier_runner
def LogMessage(message):
"""Logs a message to stderr.
Args:
message: The message string to be logged.
"""
now = datetime.datetime.now()
frameinfo = inspect.getframeinfo(inspect.currentframe().f_back)
filename = os.path.basename(frameinfo.filename)
line = frameinfo.lineno
sys.stderr.write('[%s:%s(%s)] %s\n' % (now.strftime('%m%d/%H%M%S'),
filename, line, message))
class Config: class Config:
"""Describes the machine states, actions, and test cases. """Describes the machine states, actions, and test cases.
...@@ -90,10 +106,10 @@ class InstallerTest(unittest.TestCase): ...@@ -90,10 +106,10 @@ class InstallerTest(unittest.TestCase):
for i in range(1, len(self._test), 2): for i in range(1, len(self._test), 2):
action = self._test[i] action = self._test[i]
if not self._quiet: if not self._quiet:
sys.stderr.write('Beginning action %s\n' % action) LogMessage('Beginning action %s' % action)
RunCommand(self._config.actions[action], self._variable_expander) RunCommand(self._config.actions[action], self._variable_expander)
if not self._quiet: if not self._quiet:
sys.stderr.write('Finished action %s\n' % action) LogMessage('Finished action %s' % action)
state = self._test[i + 1] state = self._test[i + 1]
self._VerifyState(state) self._VerifyState(state)
...@@ -124,7 +140,7 @@ class InstallerTest(unittest.TestCase): ...@@ -124,7 +140,7 @@ class InstallerTest(unittest.TestCase):
state: A state name. state: A state name.
""" """
if not self._quiet: if not self._quiet:
sys.stderr.write('Verifying state %s\n' % state) LogMessage('Verifying state %s' % state)
try: try:
self._verifier_runner.VerifyAll(self._config.states[state], self._verifier_runner.VerifyAll(self._config.states[state],
self._variable_expander) self._variable_expander)
...@@ -322,12 +338,12 @@ def main(): ...@@ -322,12 +338,12 @@ def main():
verbosity = 2 if not args.quiet else 1 verbosity = 2 if not args.quiet else 1
result = unittest.TextTestRunner(verbosity=verbosity).run(suite) result = unittest.TextTestRunner(verbosity=verbosity).run(suite)
if is_component_build: if is_component_build:
print ('Component build is currently unsupported by the mini_installer: ' sys.stderr.write('Component build is currently unsupported by the '
'http://crbug.com/377839') 'mini_installer: http://crbug.com/377839\n')
if args.write_full_results_to: if args.write_full_results_to:
with open(args.write_full_results_to, 'w') as fp: with open(args.write_full_results_to, 'w') as fp:
json.dump(_FullResults(suite, result, {}), fp, indent=2) json.dump(_FullResults(suite, result, {}), fp, indent=2)
fp.write("\n") fp.write('\n')
return 0 if result.wasSuccessful() else 1 return 0 if result.wasSuccessful() else 1
......
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