Changeset 213185 in webkit


Ignore:
Timestamp:
Feb 28, 2017 3:24:42 PM (7 years ago)
Author:
commit-queue@webkit.org
Message:

Add ability for webkitpy to run bindings tests
https://bugs.webkit.org/show_bug.cgi?id=168979

Patch by Srinivasan Vijayaraghavan <svijayaraghavan@apple.com> on 2017-02-28
Reviewed by Alexey Proskuryakov.

This allows the below command to run bindings tests with json output, and is a required part
of adding an EWS for bindings tests. (Note: this won't build because --build is not passed).
webkit-patch build-and-test --no-clean --no-update --test --non-interactive --group="bindings"

  • Scripts/webkitpy/port/base.py:

(Port.bindings_results_directory): Return the directory to place JSON results for bindings tests.

  • Scripts/webkitpy/tool/steps/runtests.py:

(RunTests.run): Checks if we should be running bindings tests.
(RunTests._run_bindings_tests): Generates the command for bindings tests, and executes it.

  • Scripts/webkitpy/tool/steps/steps_unittest.py:

(test_runtests_bindings): Unit test for the generated run-bindings-tests command.

Location:
trunk/Tools
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r213177 r213185  
     12017-02-28  Srinivasan Vijayaraghavan  <svijayaraghavan@apple.com>
     2
     3        Add ability for webkitpy to run bindings tests
     4        https://bugs.webkit.org/show_bug.cgi?id=168979
     5
     6        Reviewed by Alexey Proskuryakov.
     7
     8        This allows the below command to run bindings tests with json output, and is a required part
     9        of adding an EWS for bindings tests. (Note: this won't build because --build is not passed).
     10        webkit-patch build-and-test --no-clean --no-update  --test --non-interactive --group="bindings"
     11
     12        * Scripts/webkitpy/port/base.py:
     13        (Port.bindings_results_directory): Return the directory to place JSON results for bindings tests.
     14        * Scripts/webkitpy/tool/steps/runtests.py:
     15        (RunTests.run): Checks if we should be running bindings tests.
     16        (RunTests._run_bindings_tests): Generates the command for bindings tests, and executes it.
     17        * Scripts/webkitpy/tool/steps/steps_unittest.py:
     18        (test_runtests_bindings): Unit test for the generated run-bindings-tests command.
     19
    1202017-02-28  Myles C. Maxfield  <mmaxfield@apple.com>
    221
  • trunk/Tools/Scripts/webkitpy/port/base.py

    r212579 r213185  
    812812        return self._build_path()
    813813
     814    def bindings_results_directory(self):
     815        return self._build_path()
     816
    814817    def results_directory(self):
    815818        """Absolute path to the place to store the test results (uses --results-directory)."""
  • trunk/Tools/Scripts/webkitpy/tool/steps/runtests.py

    r213114 r213185  
    6161        if self._options.group == "jsc":
    6262            self._run_javascriptcore_tests()
     63            return
     64
     65        if self._options.group == "bindings":
     66            self._run_bindings_tests()
    6367            return
    6468
     
    158162        args.append("--json-output=%s" % results_file_path)
    159163        self._tool.executive.run_and_throw_if_fail(args, cwd=self._tool.scm().checkout_root)
     164
     165    def _run_bindings_tests(self):
     166        args = self._tool.deprecated_port().run_bindings_tests_command()
     167        results_directory = self._tool.port_factory.get(options=self._options).bindings_results_directory()
     168        self._tool.filesystem.maybe_make_directory(results_directory)
     169        results_file_path = self._tool.filesystem.join(results_directory, "bindings_test_results.json")
     170        args.append("--json-output=%s" % results_file_path)
     171        self._tool.executive.run_and_throw_if_fail(args, cwd=self._tool.scm().checkout_root)
  • trunk/Tools/Scripts/webkitpy/tool/steps/steps_unittest.py

    r213114 r213185  
    244244        with self.assertRaises(ScriptError):
    245245            OutputCapture().assert_outputs(self, step.run, [{}], expected_logs=expected_logs)
     246
     247    def test_runtests_bindings(self):
     248        mock_options = self._step_options()
     249        mock_options.non_interactive = False
     250        mock_options.group = "bindings"
     251        step = steps.RunTests(MockTool(log_executive=True), mock_options)
     252        tool = MockTool(log_executive=True)
     253        # FIXME: We shouldn't use a real port-object here, but there is too much to mock at the moment.
     254        tool._deprecated_port = DeprecatedPort()
     255        step = steps.RunTests(tool, mock_options)
     256        expected_logs = """MOCK run_and_throw_if_fail: ['Tools/Scripts/run-bindings-tests', '--json-output=/tmp/bindings_test_results.json'], cwd=/mock-checkout
     257"""
     258        OutputCapture().assert_outputs(self, step.run, [{}], expected_logs=expected_logs)
Note: See TracChangeset for help on using the changeset viewer.