Exemplo n.º 1
0
 def ClassifyTestWithoutBrowser(test_set, test):
   name = test.id()
   if (not args.positional_args
       or _MatchesSelectedTest(name, args.positional_args,
                                 args.exact_test_filter)):
     # TODO(telemetry-team): Make sure that all telemetry unittest that invokes
     # actual browser are subclasses of browser_test_case.BrowserTestCase
     # (crbug.com/537428)
     if issubclass(test.__class__, browser_test_case.BrowserTestCase):
       test_set.tests_to_skip.append(typ.TestInput(
           name, msg='Skip the test because it requires a browser.'))
     else:
       test_set.parallel_tests.append(typ.TestInput(name))
Exemplo n.º 2
0
 def ClassifyTestWithBrowser(test_set, test):
     name = test.id()
     if (not args.positional_args or _MatchesSelectedTest(
             name, args.positional_args, args.exact_test_filter)):
         assert hasattr(test, '_testMethodName')
         method = getattr(test, test._testMethodName)  # pylint: disable=protected-access
         should_skip, reason = decorators.ShouldSkip(
             method, possible_browser)
         if should_skip and not args.run_disabled_tests:
             test_set.tests_to_skip.append(typ.TestInput(name, msg=reason))
         elif decorators.ShouldBeIsolated(method, possible_browser):
             test_set.isolated_tests.append(typ.TestInput(name))
         else:
             test_set.parallel_tests.append(typ.TestInput(name))
Exemplo n.º 3
0
 def _SeriallyExecutedBrowserTestCaseClassifer(test_set, test):
   # Do not pick up tests that do not inherit from
   # serially_executed_browser_test_case.SeriallyExecutedBrowserTestCase
   # class.
   if not isinstance(test,
       serially_executed_browser_test_case.SeriallyExecutedBrowserTestCase):
     return
   name = test.id()
   if _SkipMatch(name, args.skip):
     test_set.tests_to_skip.append(
         typ.TestInput(name, 'skipped because matched --skip'))
     return
   # For now, only support running these tests serially.
   test_set.isolated_tests.append(typ.TestInput(name))
Exemplo n.º 4
0
 def ClassifyTestWithoutBrowser(test_set, test):
   name = test.id()
   if _SkipMatch(name, args.skip):
     test_set.tests_to_skip.append(
         typ.TestInput(name, 'skipped because matched --skip'))
     return
   if (not selected_tests or
       _MatchesSelectedTest(name, selected_tests, selected_tests_are_exact)):
     # TODO(telemetry-team): Make sure that all telemetry unittest that invokes
     # actual browser are subclasses of browser_test_case.BrowserTestCase
     # (crbug.com/537428)
     if issubclass(test.__class__, browser_test_case.BrowserTestCase):
       test_set.tests_to_skip.append(typ.TestInput(
           name, msg='Skip the test because it requires a browser.'))
     else:
       test_set.parallel_tests.append(typ.TestInput(name))
Exemplo n.º 5
0
 def ClassifyTestWithBrowser(test_set, test):
   name = test.id()
   if _SkipMatch(name, args.skip):
     test_set.tests_to_skip.append(
         typ.TestInput(name, 'skipped because matched --skip'))
     return
   if (not selected_tests or
       _MatchesSelectedTest(name, selected_tests, selected_tests_are_exact)):
     assert hasattr(test, '_testMethodName')
     method = getattr(
         test, test._testMethodName)  # pylint: disable=protected-access
     should_skip, reason = decorators.ShouldSkip(method, possible_browser)
     if should_skip and not args.run_disabled_tests:
       test_set.tests_to_skip.append(typ.TestInput(name, msg=reason))
     elif decorators.ShouldBeIsolated(method, possible_browser):
       test_set.isolated_tests.append(typ.TestInput(name))
     else:
       test_set.parallel_tests.append(typ.TestInput(name))
Exemplo n.º 6
0
 def _SeriallyExecutedBrowserTestCaseClassifer(test_set, test):
     # Do not pick up tests that do not inherit from
     # serially_executed_browser_test_case.SeriallyExecutedBrowserTestCase
     # class.
     if not isinstance(
             test, serially_executed_browser_test_case.
             SeriallyExecutedBrowserTestCase):
         return
     assert test.id().startswith(args.test_name_prefix), (
         'The test\'s fully qualified name must start with the '
         'test name prefix passed in at the command line')
     name = test.id()[len(args.test_name_prefix):]
     if _SkipMatch(name, args.skip):
         test_set.tests_to_skip.append(
             typ.TestInput(name, 'skipped because matched --skip'))
         return
     # For now, only support running these tests serially.
     test_set.isolated_tests.append(typ.TestInput(name))