Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(399)

Unified Diff: telemetry/telemetry/testing/serially_executed_browser_test_case.py

Issue 2590623002: [Telemetry] Migrate browser_test_runner to use typ as the test runner (Closed)
Patch Set: Add client_configs to the context Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: telemetry/telemetry/testing/serially_executed_browser_test_case.py
diff --git a/telemetry/telemetry/testing/serially_executed_browser_test_case.py b/telemetry/telemetry/testing/serially_executed_browser_test_case.py
index db421d0059dd8caadcdc42101620531a3ab9a6e9..5b76d661a5ffa02687e4e068e1e0555f02b23230 100644
--- a/telemetry/telemetry/testing/serially_executed_browser_test_case.py
+++ b/telemetry/telemetry/testing/serially_executed_browser_test_case.py
@@ -8,7 +8,7 @@ import unittest
from py_utils import cloud_storage
from telemetry.internal.browser import browser_finder
-from telemetry.testing import options_for_unittests
+from telemetry.testing import browser_test_context
from telemetry.util import wpr_modes
@@ -31,7 +31,7 @@ class SeriallyExecutedBrowserTestCase(unittest.TestCase):
@classmethod
def setUpClass(cls):
- cls._finder_options = options_for_unittests.GetCopy()
+ cls._finder_options = browser_test_context.GetCopy().finder_options
cls.platform = None
cls.browser = None
cls._browser_to_create = None
@@ -142,12 +142,22 @@ def LoadAllTestsInModule(module):
test cases to be run.
"""
suite = unittest.TestSuite()
+ test_context = browser_test_context.GetCopy()
for _, obj in inspect.getmembers(module):
if (inspect.isclass(obj) and
issubclass(obj, SeriallyExecutedBrowserTestCase)):
+ # We bail out early if the test class's name doesn't match the targeted
+ # test_class_name in test_context to avoid calling GenerateTestCases for
+ # tests that we don't intend to run. This is to avoid possible errors in
+ # GenerateTestCases as the test class may define custom options in
+ # the finder_options object, and hence would raise error if they can't
+ # find their custom options in finder_options object.
+ if test_context.test_class_name != obj.Name():
+ continue
for test in GenerateTestCases(
- test_class=obj, finder_options=options_for_unittests.GetCopy()):
- suite.addTest(test)
+ test_class=obj, finder_options=test_context.finder_options):
+ if test.id() in test_context.test_case_ids_to_run:
+ suite.addTest(test)
return suite

Powered by Google App Engine
This is Rietveld 408576698