def test_runtests_api_debug(self): mock_options = self._step_options() mock_options.non_interactive = False mock_options.build_style = "debug" mock_options.group = "api" step = steps.RunTests(MockTool(log_executive=True), mock_options) tool = MockTool(log_executive=True) tool._deprecated_port = DeprecatedPort() step = steps.RunTests(tool, mock_options) expected_logs = """MOCK run_and_throw_if_fail: ['Tools/Scripts/run-api-tests', '--debug', '--json-output=/tmp/api_test_results.json'], cwd=/mock-checkout """ OutputCapture().assert_outputs(self, step.run, [{}], expected_logs=expected_logs)
def test_runtests_webkitpy(self): mock_options = self._step_options() mock_options.non_interactive = False mock_options.group = "webkitpy" step = steps.RunTests(MockTool(log_executive=True), mock_options) tool = MockTool(log_executive=True) # FIXME: We shouldn't use a real port-object here, but there is too much to mock at the moment. tool._deprecated_port = DeprecatedPort() step = steps.RunTests(tool, mock_options) expected_logs = """MOCK run_and_throw_if_fail: ['Tools/Scripts/test-webkitpy', '--json-output=/tmp/python-unittest-results/webkitpy_test_results.json'], cwd=/mock-checkout """ OutputCapture().assert_outputs(self, step.run, [{}], expected_logs=expected_logs)
def test_runtests_jsc(self): mock_options = self._step_options() mock_options.non_interactive = False mock_options.build_style = "release" mock_options.group = "jsc" step = steps.RunTests(MockTool(log_executive=True), mock_options) tool = MockTool(log_executive=True) # FIXME: We shouldn't use a real port-object here, but there is too much to mock at the moment. tool._deprecated_port = DeprecatedPort() step = steps.RunTests(tool, mock_options) expected_logs = """MOCK run_and_throw_if_fail: ['Tools/Scripts/run-javascriptcore-tests', '--no-fail-fast', '--release', '--json-output=/tmp/jsc_test_results.json'], cwd=/mock-checkout """ OutputCapture().assert_outputs(self, step.run, [{}], expected_logs=expected_logs)
def test_runtests_jsc(self): mock_options = self._step_options() mock_options.non_interactive = False mock_options.build_style = "release" mock_options.group = "jsc" step = steps.RunTests(MockTool(log_executive=True), mock_options) tool = MockTool(log_executive=True) # FIXME: We shouldn't use a real port-object here, but there is too much to mock at the moment. tool._deprecated_port = DeprecatedPort() step = steps.RunTests(tool, mock_options) with OutputCapture(level=logging.INFO) as captured: step.run({}) self.assertEqual( captured.root.log.getvalue(), "MOCK run_and_throw_if_fail: ['Tools/Scripts/run-javascriptcore-tests', '--no-fail-fast', '--release', '--json-output=/tmp/jsc_test_results.json'], cwd=/mock-checkout\n", )
def test_runtests_args(self): mock_options = self._step_options() step = steps.RunTests(MockTool(log_executive=True), mock_options) # FIXME: We shouldn't use a real port-object here, but there is too much to mock at the moment. mock_port = WebKitPort() mock_port.name = lambda: "Mac" tool = MockTool(log_executive=True) tool.port = lambda: mock_port step = steps.RunTests(tool, mock_options) expected_stderr = """Running Python unit tests MOCK run_and_throw_if_fail: ['Tools/Scripts/test-webkitpy'], cwd=/mock-checkout Running Perl unit tests MOCK run_and_throw_if_fail: ['Tools/Scripts/test-webkitperl'], cwd=/mock-checkout Running JavaScriptCore tests MOCK run_and_throw_if_fail: ['Tools/Scripts/run-javascriptcore-tests'], cwd=/mock-checkout Running run-webkit-tests MOCK run_and_throw_if_fail: ['Tools/Scripts/run-webkit-tests', '--no-new-test-results', '--no-launch-safari', '--exit-after-n-failures=30', '--quiet'], cwd=/mock-checkout """ OutputCapture().assert_outputs(self, step.run, [{}], expected_stderr=expected_stderr)
def test_runtests_debug_args(self): mock_options = self._step_options() mock_options.non_interactive = False mock_options.build_style = "debug" step = steps.RunTests(MockTool(log_executive=True), mock_options) tool = MockTool(log_executive=True) # FIXME: We shouldn't use a real port-object here, but there is too much to mock at the moment. tool._deprecated_port = DeprecatedPort() step = steps.RunTests(tool, mock_options) expected_logs = """Running Python unit tests MOCK run_and_throw_if_fail: ['Tools/Scripts/test-webkitpy'], cwd=/mock-checkout Running Perl unit tests MOCK run_and_throw_if_fail: ['Tools/Scripts/test-webkitperl'], cwd=/mock-checkout Running JavaScriptCore tests MOCK run_and_throw_if_fail: ['Tools/Scripts/run-javascriptcore-tests', '--no-fail-fast'], cwd=/mock-checkout Running run-webkit-tests MOCK run_and_throw_if_fail: ['Tools/Scripts/run-webkit-tests', '--debug', '--quiet'], cwd=/mock-checkout """ OutputCapture().assert_outputs(self, step.run, [{}], expected_logs=expected_logs)
def test_runtests_args(self): mock_options = self._step_options() mock_options.non_interactive = False step = steps.RunTests(MockTool(log_executive=True), mock_options) tool = MockTool(log_executive=True) step = steps.RunTests(tool, mock_options) expected_logs = """Running Python unit tests MOCK run_and_throw_if_fail: ['mock-test-webkitpy'], cwd=/mock-checkout Running Perl unit tests MOCK run_and_throw_if_fail: ['mock-test-webkitperl'], cwd=/mock-checkout Running JavaScriptCore tests MOCK run_and_throw_if_fail: ['mock-run-javascriptcore-tests'], cwd=/mock-checkout Running bindings generation tests MOCK run_and_throw_if_fail: ['mock-run-bindings-tests'], cwd=/mock-checkout Running WebKit unit tests MOCK run_and_throw_if_fail: ['mock-run-webkit-unit-tests'], cwd=/mock-checkout Running run-webkit-tests MOCK run_and_throw_if_fail: ['mock-run-webkit-tests', '--quiet'], cwd=/mock-checkout """ OutputCapture().assert_outputs(self, step.run, [{}], expected_logs=expected_logs)
def test_runtests_debug_args(self): mock_options = self._step_options() mock_options.non_interactive = False mock_options.build_style = "debug" step = steps.RunTests(MockTool(log_executive=True), mock_options) tool = MockTool(log_executive=True) # FIXME: We shouldn't use a real port-object here, but there is too much to mock at the moment. tool._deprecated_port = DeprecatedPort() step = steps.RunTests(tool, mock_options) with OutputCapture(level=logging.INFO) as captured: step.run({}) self.assertEqual( captured.root.log.getvalue(), '''Running Python unit tests MOCK run_and_throw_if_fail: ['Tools/Scripts/test-webkitpy'], cwd=/mock-checkout Running Perl unit tests MOCK run_and_throw_if_fail: ['Tools/Scripts/test-webkitperl'], cwd=/mock-checkout Running JavaScriptCore tests MOCK run_and_throw_if_fail: ['Tools/Scripts/run-javascriptcore-tests', '--no-fail-fast'], cwd=/mock-checkout Running run-webkit-tests MOCK run_and_throw_if_fail: ['Tools/Scripts/run-webkit-tests', '--debug', '--quiet'], cwd=/mock-checkout ''', )
def test_runtests_jsc_debug(self): mock_options = self._step_options() mock_options.non_interactive = False mock_options.build_style = "debug" mock_options.group = "jsc" tool = MockTool(log_executive=True) # FIXME: We shouldn't use a real port-object here, but there is too much to mock at the moment. tool._deprecated_port = DeprecatedPort() step = steps.RunTests(tool, mock_options) expected_logs = """MOCK run_command: ['perl', 'Tools/Scripts/webkit-build-directory', '--configuration', '--release', '--mac'], cwd=/mock-checkout MOCK run_and_throw_if_fail: ['Tools/Scripts/run-javascriptcore-tests', '--no-fail-fast', '--debug', '--json-output=/MOCK output of child process/jsc_test_results.json'], cwd=/mock-checkout """ OutputCapture().assert_outputs(self, step.run, [{}], expected_logs=expected_logs)