Commit fdd9f7c6 authored by Lindsay Pasricha's avatar Lindsay Pasricha Committed by Commit Bot

Revert "Enable iOS test runner unit tests as part of presubmit"

This reverts commit 7d6c5197.

Reason for revert: This breaks on device runs for xcodebuild_runner.
This revert will land before the revert of crrev/c/2048851.

Original change's description:
> Enable iOS test runner unit tests as part of presubmit
> 
> Run iOS test runner unit tests as part of presubmit. Keeping scope to
> functional tests, and will have separate CLs for the remaining files
> that require further fixes.
> 
> * PRESUBMIT.py - include unit test execution for ios/build/bots/scripts
> * run.py - unit tests caught logic incorrectness. Running the json
>    parsing first, before validation.
> * wpr_runner_test.py - remove install xcode mock, fixed broken tests
> * test_apps_test.py and xcode_log_parser_test.py - include main call
>    to unittest.
> 
> Bug: 1056457,1058257
> Change-Id: Ifc233695ba8f6120f862586a497df61e96d4954f
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2076765
> Reviewed-by: Rohit Rao <rohitrao@chromium.org>
> Commit-Queue: Jeff Yoon <jeffyoon@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#746102}

TBR=rohitrao@chromium.org,lindsayw@chromium.org,zhaoyangli@chromium.org,jeffyoon@chromium.org

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

Bug: 1056457
Change-Id: Iaa9e1ca8a6ac76c41e067d17e13108aeeb2ac83a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2089992Reviewed-by: default avatarRohit Rao <rohitrao@chromium.org>
Commit-Queue: Lindsay Pasricha <lindsayw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#747396}
parent 4ca48851
# Copyright 2020 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Presubmit script for ios test runner scripts.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmit API built into depot_tools.
"""
def _RunTestRunnerUnitTests(input_api, output_api):
""" Runs iOS test runner unit tests """
# TODO(crbug.com/1056457): Replace whitelist with regex ".*_test.py" once
# all test files are fixed.
files = [
'coverage_util_test.py',
# 'iossim_util_test.py',
'run_test.py',
'shard_util_test.py',
'test_apps_test.py',
# 'test_runner_test.py',
'wpr_runner_test.py',
# 'xcode_log_parser_test.py',
# 'xcodebuild_runner_test.py',
]
return input_api.canned_checks.RunUnitTestsInDirectory(
input_api, output_api, '.', whitelist=files)
def CheckChange(input_api, output_api):
results = []
results.extend(_RunTestRunnerUnitTests(input_api, output_api))
return results
def CheckChangeOnCommit(input_api, output_api):
return CheckChange(input_api, output_api)
def CheckChangeOnUpload(input_api, output_api):
return CheckChange(input_api, output_api)
...@@ -436,8 +436,8 @@ class Runner(): ...@@ -436,8 +436,8 @@ class Runner():
'both -p/--platform and -v/--version') 'both -p/--platform and -v/--version')
args, test_args = parser.parse_known_args(args) args, test_args = parser.parse_known_args(args)
load_from_json(args)
validate(args) validate(args)
load_from_json(args)
self.args = args self.args = args
self.test_args = test_args self.test_args = test_args
......
...@@ -3,8 +3,6 @@ ...@@ -3,8 +3,6 @@
# found in the LICENSE file. # found in the LICENSE file.
"""Unittests for test_apps.py.""" """Unittests for test_apps.py."""
import unittest
import test_apps import test_apps
import test_runner_test import test_runner_test
...@@ -56,7 +54,3 @@ class GetGTestFilterTest(test_runner_test.TestCase): ...@@ -56,7 +54,3 @@ class GetGTestFilterTest(test_runner_test.TestCase):
expected = '-test.1:test.2' expected = '-test.1:test.2'
self.assertEqual(test_apps.get_gtest_filter(tests, invert=True), expected) self.assertEqual(test_apps.get_gtest_filter(tests, invert=True), expected)
if __name__ == '__main__':
unittest.main()
\ No newline at end of file
...@@ -21,8 +21,12 @@ class WprProxySimulatorTestRunnerTest(test_runner_test.TestCase): ...@@ -21,8 +21,12 @@ class WprProxySimulatorTestRunnerTest(test_runner_test.TestCase):
def setUp(self): def setUp(self):
super(WprProxySimulatorTestRunnerTest, self).setUp() super(WprProxySimulatorTestRunnerTest, self).setUp()
def install_xcode(build, mac_toolchain_cmd, xcode_app_path):
return True
self.mock(test_runner, 'get_current_xcode_info', lambda: { self.mock(test_runner, 'get_current_xcode_info', lambda: {
'version': 'test version', 'build': 'test build', 'path': 'test/path'}) 'version': 'test version', 'build': 'test build', 'path': 'test/path'})
self.mock(test_runner, 'install_xcode', install_xcode)
self.mock(test_runner.subprocess, 'check_output', self.mock(test_runner.subprocess, 'check_output',
lambda _: 'fake-bundle-id') lambda _: 'fake-bundle-id')
self.mock(os.path, 'abspath', lambda path: '/abs/path/to/%s' % path) self.mock(os.path, 'abspath', lambda path: '/abs/path/to/%s' % path)
...@@ -52,6 +56,8 @@ class WprProxySimulatorTestRunnerTest(test_runner_test.TestCase): ...@@ -52,6 +56,8 @@ class WprProxySimulatorTestRunnerTest(test_runner_test.TestCase):
'platform', 'platform',
'os', 'os',
'wpr-tools-path', 'wpr-tools-path',
'xcode-version',
'xcode-build',
'out-dir', 'out-dir',
) )
...@@ -69,6 +75,8 @@ class WprProxySimulatorTestRunnerTest(test_runner_test.TestCase): ...@@ -69,6 +75,8 @@ class WprProxySimulatorTestRunnerTest(test_runner_test.TestCase):
'platform', 'platform',
'os', 'os',
'wpr-tools-path', 'wpr-tools-path',
'xcode-version',
'xcode-build',
'out-dir', 'out-dir',
) )
...@@ -86,6 +94,8 @@ class WprProxySimulatorTestRunnerTest(test_runner_test.TestCase): ...@@ -86,6 +94,8 @@ class WprProxySimulatorTestRunnerTest(test_runner_test.TestCase):
'platform', 'platform',
'os', 'os',
'bad-tools-path', 'bad-tools-path',
'xcode-version',
'xcode-build',
'out-dir', 'out-dir',
) )
...@@ -99,6 +109,8 @@ class WprProxySimulatorTestRunnerTest(test_runner_test.TestCase): ...@@ -99,6 +109,8 @@ class WprProxySimulatorTestRunnerTest(test_runner_test.TestCase):
'platform', 'platform',
'os', 'os',
'wpr-tools-path', 'wpr-tools-path',
'xcode-version',
'xcode-build',
'out-dir', 'out-dir',
) )
...@@ -153,6 +165,8 @@ class WprProxySimulatorTestRunnerTest(test_runner_test.TestCase): ...@@ -153,6 +165,8 @@ class WprProxySimulatorTestRunnerTest(test_runner_test.TestCase):
'platform', 'platform',
'os', 'os',
'wpr-tools-path', 'wpr-tools-path',
'xcode-version',
'xcode-build',
'out-dir', 'out-dir',
) )
self.mock(wpr_runner.WprProxySimulatorTestRunner, 'wprgo_start', self.mock(wpr_runner.WprProxySimulatorTestRunner, 'wprgo_start',
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
import json import json
import mock import mock
import os import os
import unittest
import test_runner import test_runner
import test_runner_test import test_runner_test
...@@ -270,7 +269,3 @@ class XCode11LogParserTest(test_runner_test.TestCase): ...@@ -270,7 +269,3 @@ class XCode11LogParserTest(test_runner_test.TestCase):
res['failed']['BUILD_INTERRUPTED']) res['failed']['BUILD_INTERRUPTED'])
self.assertEqual(['TestCase1/method1', 'TestCase2/method1'], self.assertEqual(['TestCase1/method1', 'TestCase2/method1'],
res['passed']) res['passed'])
if __name__ == '__main__':
unittest.main()
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