Changeset 261629 in webkit


Ignore:
Timestamp:
May 13, 2020 11:37:46 AM (4 years ago)
Author:
Matt Lewis
Message:

Run-webkit-tests should not fail if all tests found to run are skipped.
https://bugs.webkit.org/show_bug.cgi?id=210880

Reviewed by Jonathan Bedard.

  • Scripts/webkitpy/layout_tests/controllers/manager.py:

(Manager.run): Added a check to see if we skiped all tests. If so We return a successful exit
code as we performed as expected.

  • Scripts/webkitpy/layout_tests/models/test_run_results.py:

(RunDetails.init): Added in an additional class variable to be used as a way to record an
all skipped result check.

  • Scripts/webkitpy/layout_tests/run_webkit_tests.py:

(main): Added a all test skipped check and we return early with the exit code.

  • Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py: Added a new test and removed the old

ones that no longer test the correct functionality.
(RunTest.test_all_tests_skipped):
(RunTest.test_no_tests_found): Deleted.
(RunTest.test_no_tests_found_2): Deleted.

Location:
trunk/Tools
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r261620 r261629  
     12020-05-12  Matt Lewis  <jlewis3@apple.com>
     2
     3        Run-webkit-tests should not fail if all tests found to run are skipped.
     4        https://bugs.webkit.org/show_bug.cgi?id=210880
     5
     6        Reviewed by Jonathan Bedard.
     7
     8        * Scripts/webkitpy/layout_tests/controllers/manager.py:
     9        (Manager.run): Added a check to see if we skiped all tests. If so We return a successful exit
     10        code as we performed as expected.
     11        * Scripts/webkitpy/layout_tests/models/test_run_results.py:
     12        (RunDetails.__init__): Added in an additional class variable to be used as a way to record an
     13        all skipped result check.
     14        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
     15        (main): Added a all test skipped check and we return early with the exit code.
     16        * Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py: Added a new test and removed the old
     17        ones that no longer test the correct functionality.
     18        (RunTest.test_all_tests_skipped):
     19        (RunTest.test_no_tests_found): Deleted.
     20        (RunTest.test_no_tests_found_2): Deleted.
     21
    1222020-05-13  Kate Cheney  <katherine_cheney@apple.com>
    223
  • trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py

    r255240 r261629  
    219219        start_time = time.time()
    220220
    221         # Check to make sure we're not skipping every test.
     221        # Check to see if all tests we are running are skipped.
     222        if tests_to_skip == total_tests:
     223            _log.error("All tests skipped.")
     224            return test_run_results.RunDetails(exit_code=0, skipped_all_tests=True)
     225
     226        # Check to make sure we have no tests to run that are not skipped.
    222227        if not sum([len(tests) for tests in itervalues(tests_to_run_by_device)]):
    223228            _log.critical('No tests to run.')
  • trunk/Tools/Scripts/webkitpy/layout_tests/models/test_run_results.py

    r257144 r261629  
    158158
    159159class RunDetails(object):
    160     def __init__(self, exit_code, summarized_results=None, initial_results=None, retry_results=None, enabled_pixel_tests_in_retry=False):
     160    def __init__(self, exit_code, summarized_results=None, initial_results=None, retry_results=None, enabled_pixel_tests_in_retry=False, skipped_all_tests=False):
    161161        self.exit_code = exit_code
    162162        self.summarized_results = summarized_results
     
    164164        self.retry_results = retry_results
    165165        self.enabled_pixel_tests_in_retry = enabled_pixel_tests_in_retry
     166        self.skipped_all_tests = skipped_all_tests
    166167
    167168
  • trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py

    r259667 r261629  
    9090        options.additional_env_var.append('__XPC_JSC_maxPerThreadStackUsage=' + str(stackSizeInBytes))
    9191        run_details = run(port, options, args, stderr)
     92        if run_details.exit_code != -1 and run_details.skipped_all_tests:
     93            return run_details.exit_code
    9294        if run_details.exit_code != -1 and not run_details.initial_results.keyboard_interrupted:
    9395            bot_printer = buildbot_results.BuildBotPrinter(stdout, options.debug_rwt_logging)
  • trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py

    r258075 r261629  
    281281            self.assertTrue(any(['Interrupted, exiting' in line for line in regular_output.getvalue().splitlines()]))
    282282
    283     def test_no_tests_found(self):
    284         details, err, _ = logging_run(['resources'], tests_included=True)
    285         self.assertEqual(details.exit_code, -1)
    286         self.assertContains(err, 'No tests to run.\n')
    287 
    288     def test_no_tests_found_2(self):
     283    def test_all_tests_skipped(self):
    289284        details, err, _ = logging_run(['foo'], tests_included=True)
    290         self.assertEqual(details.exit_code, -1)
    291         self.assertContains(err, 'No tests to run.\n')
     285        self.assertEqual(details.exit_code, 0)
     286        self.assertContains(err, 'All tests skipped.\n')
    292287
    293288    def test_natural_order(self):
Note: See TracChangeset for help on using the changeset viewer.