Title: [261697] branches/safari-609-branch/Tools
Revision
261697
Author
ryanhad...@apple.com
Date
2020-05-14 10:54:45 -0700 (Thu, 14 May 2020)

Log Message

Cherry-pick r261629. rdar://problem/62213993

    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.

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@261629 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: branches/safari-609-branch/Tools/ChangeLog (261696 => 261697)


--- branches/safari-609-branch/Tools/ChangeLog	2020-05-14 16:59:13 UTC (rev 261696)
+++ branches/safari-609-branch/Tools/ChangeLog	2020-05-14 17:54:45 UTC (rev 261697)
@@ -1,3 +1,49 @@
+2020-05-14  Ryan Haddad  <ryanhad...@apple.com>
+
+        Cherry-pick r261629. rdar://problem/62213993
+
+    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.
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@261629 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2020-05-12  Matt Lewis  <jlew...@apple.com>
+
+            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.
+
 2020-05-11  Alan Coon  <alanc...@apple.com>
 
         Cherry-pick r259669. rdar://problem/63111225

Modified: branches/safari-609-branch/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py (261696 => 261697)


--- branches/safari-609-branch/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py	2020-05-14 16:59:13 UTC (rev 261696)
+++ branches/safari-609-branch/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py	2020-05-14 17:54:45 UTC (rev 261697)
@@ -218,7 +218,12 @@
         self._printer.print_found(len(aggregate_test_names), len(aggregate_tests), self._options.repeat_each, self._options.iterations)
         start_time = time.time()
 
-        # Check to make sure we're not skipping every test.
+        # Check to see if all tests we are running are skipped.
+        if tests_to_skip == total_tests:
+            _log.error("All tests skipped.")
+            return test_run_results.RunDetails(exit_code=0, skipped_all_tests=True)
+
+        # Check to make sure we have no tests to run that are not skipped.
         if not sum([len(tests) for tests in itervalues(tests_to_run_by_device)]):
             _log.critical('No tests to run.')
             return test_run_results.RunDetails(exit_code=-1)

Modified: branches/safari-609-branch/Tools/Scripts/webkitpy/layout_tests/models/test_run_results.py (261696 => 261697)


--- branches/safari-609-branch/Tools/Scripts/webkitpy/layout_tests/models/test_run_results.py	2020-05-14 16:59:13 UTC (rev 261696)
+++ branches/safari-609-branch/Tools/Scripts/webkitpy/layout_tests/models/test_run_results.py	2020-05-14 17:54:45 UTC (rev 261697)
@@ -157,12 +157,13 @@
 
 
 class RunDetails(object):
-    def __init__(self, exit_code, summarized_results=None, initial_results=None, retry_results=None, enabled_pixel_tests_in_retry=False):
+    def __init__(self, exit_code, summarized_results=None, initial_results=None, retry_results=None, enabled_pixel_tests_in_retry=False, skipped_all_tests=False):
         self.exit_code = exit_code
         self.summarized_results = summarized_results
         self.initial_results = initial_results
         self.retry_results = retry_results
         self.enabled_pixel_tests_in_retry = enabled_pixel_tests_in_retry
+        self.skipped_all_tests = skipped_all_tests
 
 
 def _interpret_test_failures(failures):

Modified: branches/safari-609-branch/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py (261696 => 261697)


--- branches/safari-609-branch/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py	2020-05-14 16:59:13 UTC (rev 261696)
+++ branches/safari-609-branch/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py	2020-05-14 17:54:45 UTC (rev 261697)
@@ -89,6 +89,8 @@
         options.additional_env_var.append('JSC_maxPerThreadStackUsage=' + str(stackSizeInBytes))
         options.additional_env_var.append('__XPC_JSC_maxPerThreadStackUsage=' + str(stackSizeInBytes))
         run_details = run(port, options, args, stderr)
+        if run_details.exit_code != -1 and run_details.skipped_all_tests:
+            return run_details.exit_code
         if run_details.exit_code != -1 and not run_details.initial_results.keyboard_interrupted:
             bot_printer = buildbot_results.BuildBotPrinter(stdout, options.debug_rwt_logging)
             bot_printer.print_results(run_details)

Modified: branches/safari-609-branch/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py (261696 => 261697)


--- branches/safari-609-branch/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py	2020-05-14 16:59:13 UTC (rev 261696)
+++ branches/safari-609-branch/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py	2020-05-14 17:54:45 UTC (rev 261697)
@@ -274,15 +274,10 @@
             _, regular_output, _ = logging_run(['failures/expected/keyboard.html', 'passes/text.html', '--child-processes', '2', '--force'], tests_included=True, shared_port=False)
             self.assertTrue(any(['Interrupted, exiting' in line for line in regular_output.buflist]))
 
-    def test_no_tests_found(self):
-        details, err, _ = logging_run(['resources'], tests_included=True)
-        self.assertEqual(details.exit_code, -1)
-        self.assertContains(err, 'No tests to run.\n')
-
-    def test_no_tests_found_2(self):
+    def test_all_tests_skipped(self):
         details, err, _ = logging_run(['foo'], tests_included=True)
-        self.assertEqual(details.exit_code, -1)
-        self.assertContains(err, 'No tests to run.\n')
+        self.assertEqual(details.exit_code, 0)
+        self.assertContains(err, 'All tests skipped.\n')
 
     def test_natural_order(self):
         tests_to_run = ['passes/audio.html', 'failures/expected/text.html', 'failures/expected/missing_text.html', 'passes/args.html']
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to