Commit 0a92f2b8 authored by Cole Winstanley's avatar Cole Winstanley Committed by Commit Bot

Revert "[ChromeDriver] Add replay end-to-end tests to run_all_tests.py"

This reverts commit 1ffe88a7.

Reason for revert: Causing ChromeDriver waterfall issues

Original change's description:
> [ChromeDriver] Add replay end-to-end tests to run_all_tests.py
> 
> This change adds the end-to-end tests for the client replay component
> of ChromeDriver to the ChromeDriver waterfall by incorporating them
> into the existing run_all_tests.py. This will extend the waterfall
> coverage to include the ChromeDriver log-replay component.
> 
> Bug: chromedriver:2501
> Change-Id: I6e35675d2598a2a33c67340e0ee73e05201c3439
> Reviewed-on: https://chromium-review.googlesource.com/1174894
> Commit-Queue: Cole Winstanley <cwinstanley@google.com>
> Reviewed-by: Caleb Rouleau <crouleau@chromium.org>
> Reviewed-by: John Chen <johnchen@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#584518}

TBR=crouleau@chromium.org,johnchen@chromium.org,cwinstanley@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: chromedriver:2501
Change-Id: I6f0eec4d77b0608a38b9ccc4efcacd1b948c8c46
Reviewed-on: https://chromium-review.googlesource.com/1183827Reviewed-by: default avatarJohn Chen <johnchen@chromium.org>
Commit-Queue: Cole Winstanley <cwinstanley@google.com>
Cr-Commit-Position: refs/heads/master@{#584925}
parent 8a2e40fe
......@@ -33,15 +33,6 @@ import webserver
sys.path.remove(_TEST_DIR)
# pylint: enable=g-import-not-at-top, g-bad-import-order
_VERSION_SPECIFIC_NEGATIVE_FILTER = {}
_VERSION_SPECIFIC_NEGATIVE_FILTER["67"] = [
# The wording of an error changed between Chrome 67 and 68 that makes
# testCloseWindow fail because we compare the newer error in the log
# file to the old error given by Chrome 67 and find a difference.
"*testCloseWindow"
]
def SubstituteVariableEntries(s):
"""Identifies and removes items that can legitimately vary between runs."""
......@@ -206,14 +197,6 @@ class ChromeDriverClientReplayTest(unittest.TestCase):
def testChromeBinary(self):
self.runTest("test_data/testChromeBinary.log")
def GetNegativeFilter(chrome_version):
if chrome_version in _VERSION_SPECIFIC_FILTER:
negative_filter = _VERSION_SPECIFIC_FILTER[chrome_version]
return "*-" + ":__main__.".join([""] + negative_filter)
return "*"
def main():
usage = "usage: %prog <chromedriver binary> [options]"
parser = optparse.OptionParser(usage=usage)
......@@ -223,17 +206,11 @@ def main():
parser.add_option(
"", "--chrome", help="Path to the desired Chrome binary.")
parser.add_option(
"", "--chrome-version", default="HEAD",
help="Version of Chrome. Default is 'HEAD'.")
parser.add_option(
"", "--filter", type="string", default="",
help="Filter for specifying what tests to run, \"*\" will run all,"
"including tests excluded by default. E.g., *testRunMethod")
"", "--filter", type="string", default="*",
help="Filter for specifying what tests to run, \"*\" will run all. E.g., "
"*testRunMethod")
# Need global to access these from the test runner.
# pylint: disable=global-variable-undefined
global _OPTIONS, _CHROMEDRIVER
# pylint: enable=global-variable-undefined
_OPTIONS, args = parser.parse_args()
_CHROMEDRIVER = util.GetAbsolutePathOfUserPath(args[0])
if not os.path.exists(_CHROMEDRIVER):
......@@ -245,13 +222,9 @@ def main():
all_tests_suite = unittest.defaultTestLoader.loadTestsFromModule(
sys.modules[__name__])
test_filter = (GetNegativeFilter(_OPTIONS.chrome_version)
if _OPTIONS.filter == "" else _OPTIONS.filter)
tests = unittest_util.FilterTestSuite(all_tests_suite, test_filter)
tests = unittest_util.FilterTestSuite(all_tests_suite, _OPTIONS.filter)
result = unittest.TextTestRunner(stream=sys.stdout, verbosity=2).run(tests)
sys.exit(len(result.failures) + len(result.errors))
if __name__ == "__main__":
main()
main()
\ No newline at end of file
......@@ -14,7 +14,6 @@ import tempfile
import traceback
_THIS_DIR = os.path.abspath(os.path.dirname(__file__))
_PARENT_DIR = os.path.join(_THIS_DIR, os.pardir)
sys.path.insert(0, os.path.join(_THIS_DIR, os.pardir))
import archive
......@@ -58,32 +57,6 @@ def _GenerateTestCommand(script,
return cmd
def RunReplayTests(chromedriver, chrome=None,
chrome_version=None, chrome_version_name=None):
version_info = ''
if chrome_version_name:
version_info = '(%s)' % chrome_version_name
util.MarkBuildStepStart('replay_tests%s' % version_info)
_, log_path = tempfile.mkstemp(prefix='chromedriver_log_')
print 'chromedriver server log: %s' % log_path
cmd = [
sys.executable,
os.path.join(_PARENT_DIR, 'log_replay', 'client_replay_test.py'),
chromedriver,
'--output-log-path=%s' % log_path
]
if chrome:
cmd.append('--chrome=%s' % chrome)
if chrome_version:
cmd.append('--chrome-version=%s' % chrome_version)
code = util.RunCommand(cmd)
if code:
util.MarkBuildStepError()
return code
def RunPythonTests(chromedriver, ref_chromedriver,
chrome=None, chrome_version=None,
chrome_version_name=None, android_package=None):
......@@ -258,11 +231,7 @@ def main():
chrome_version=version,
chrome_version_name='v%s' % version_name,
verbose=True)
code3 = RunReplayTests(chromedriver,
chrome=chrome_path,
chrome_version=version,
chrome_version_name='v%s' % version_name)
code = code or code1 or code2 or code3
code = code or code1 or code2
_KillChromes()
shutil.rmtree(temp_dir)
cpp_tests = os.path.join(build_dir, cpp_tests_name)
......
......@@ -101,6 +101,11 @@ _VERSION_SPECIFIC_FILTER['69'] = [
'HeadlessInvalidCertificateTest.*',
]
_VERSION_SPECIFIC_FILTER['68'] = []
_VERSION_SPECIFIC_FILTER['67'] = []
_OS_SPECIFIC_FILTER = {}
_OS_SPECIFIC_FILTER['win'] = [
# https://bugs.chromium.org/p/chromedriver/issues/detail?id=299
......@@ -2889,9 +2894,9 @@ if __name__ == '__main__':
'', '--chrome-version', default='HEAD',
help='Version of chrome. Default is \'HEAD\'.')
parser.add_option(
"", "--filter", type="string", default="",
help="Filter for specifying what tests to run, \"*\" will run all,"
"including tests excluded by default. E.g., *testRunMethod")
'', '--filter', type='string', default='*',
help=('Filter for specifying what tests to run, "*" will run all. E.g., '
'*testStartStop'))
parser.add_option(
'', '--android-package',
help=('Android package key. Possible values: ' +
......@@ -2949,7 +2954,7 @@ if __name__ == '__main__':
if _ANDROID_PACKAGE_KEY:
devil_chromium.Initialize()
if options.filter == '':
if options.filter == '*':
if _ANDROID_PACKAGE_KEY:
negative_filter = _ANDROID_NEGATIVE_FILTER[_ANDROID_PACKAGE_KEY]
else:
......
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