Commit be51036a authored by David Roger's avatar David Roger Committed by Commit Bot

Revert "[updater] pass build dir to tests."

This reverts commit b227bf9d.

Reason for revert: breaks compare_build_artifacts
https://ci.chromium.org/p/chromium/builders/ci/Windows%20deterministic/17383

Original change's description:
> [updater] pass build dir to tests.
>
> Also changes test case superclass to typ.TestCase.
>
> Bug: 1141577
> Change-Id: I0d9b4b38543d1cd904808d9f85b6aa27ab973c5d
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2496180
> Reviewed-by: Sorin Jianu <sorin@chromium.org>
> Commit-Queue: Anjali Doneria <adoneria@google.com>
> Cr-Commit-Position: refs/heads/master@{#820849}

TBR=sorin@chromium.org,waffles@chromium.org,adoneria@google.com

Change-Id: I81e2ec26e7b68f8de2ac7ceb304dcfbc11e90a97
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1141577
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2502022Reviewed-by: default avatarDavid Roger <droger@chromium.org>
Commit-Queue: David Roger <droger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#821166}
parent 60ec3002
...@@ -347,13 +347,9 @@ if (is_win || is_mac) { ...@@ -347,13 +347,9 @@ if (is_win || is_mac) {
script_test("updater_integration_tests") { script_test("updater_integration_tests") {
script = "//testing/scripts/run_isolated_script_test.py" script = "//testing/scripts/run_isolated_script_test.py"
args = [ args = [ "@WrappedPath(" +
"@WrappedPath(" + rebase_path("//chrome/updater/run_updater_tests.py",
rebase_path("//chrome/updater/run_updater_tests.py", root_build_dir) + root_build_dir) + ")" ]
")",
"--build-dir",
"@WrappedPath(" + rebase_path(root_build_dir) + ")",
]
data = [ data = [
"//chrome/updater/run_updater_tests.py", "//chrome/updater/run_updater_tests.py",
......
...@@ -2,8 +2,6 @@ ...@@ -2,8 +2,6 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
import argparse
import logging
import sys import sys
from test.integration_tests.common import path_finder from test.integration_tests.common import path_finder
...@@ -11,34 +9,12 @@ path_finder.add_typ_dir_to_sys_path() ...@@ -11,34 +9,12 @@ path_finder.add_typ_dir_to_sys_path()
import typ import typ
class Context(object):
def __init__(self, build_dir):
self.build_dir = build_dir
def main(): def main():
parser = typ.ArgumentParser() return typ.main(
parser.add_argument('--build-dir', tests=[path_finder.get_integration_tests_dir()],
help='Specifies chromium build directory.') )
runner = typ.Runner()
# Set this when using context that will be passed to tests.
runner.win_multiprocessing = typ.WinMultiprocessing.importable
runner.parse_args(parser,
argv=None,
tests=[path_finder.get_integration_tests_dir()])
# setup logging level
if runner.args.verbose > 1:
level = logging.DEBUG
else:
level = logging.INFO
logging.basicConfig(level=level)
runner.context = Context(runner.args.build_dir)
return runner.run()[0]
if __name__ == "__main__": if __name__ == "__main__":
sys.exit(main()) sys.exit(main())
...@@ -4,20 +4,13 @@ ...@@ -4,20 +4,13 @@
"""Sample test case to run on chromium infra.""" """Sample test case to run on chromium infra."""
import logging import unittest
import typ
class HelloTest(typ.TestCase): class HelloTest(unittest.TestCase):
def test_hello(self): def test_hello(self):
logging.info('Hello World!')
pass pass
def test_build_dir(self):
logging.debug('Build dir = %s', self.context.build_dir)
self.assertTrue(self.context.build_dir is not None)
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()
...@@ -12,12 +12,13 @@ intended action before test run and after test run respectively. ...@@ -12,12 +12,13 @@ intended action before test run and after test run respectively.
import logging import logging
import os import os
import typ import unittest
from test.integration_tests.common import logger_util from test.integration_tests.common import logger_util
from test.integration_tests.updater.lib import updater_util from test.integration_tests.updater.lib import updater_util
class UpdaterTestBase(typ.TestCase): class UpdaterTestBase(unittest.TestCase):
"""Base test class for updater testing on new infra.""" """Base test class for updater testing on new infra."""
@classmethod @classmethod
......
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