Exemplo n.º 1
0
    def test_http_locking(tester):
        class LockCheckingManager(Manager):
            def __init__(self, port, options, printer):
                super(LockCheckingManager, self).__init__(port, options, printer)
                self._finished_list_called = False

            def handle_finished_list(self, source, list_name, num_tests, elapsed_time):
                if not self._finished_list_called:
                    tester.assertEquals(list_name, 'locked_tests')
                    tester.assertTrue(self._remaining_locked_shards)
                    tester.assertTrue(self._has_http_lock)

                super(LockCheckingManager, self).handle_finished_list(source, list_name, num_tests, elapsed_time)

                if not self._finished_list_called:
                    tester.assertEquals(self._remaining_locked_shards, [])
                    tester.assertFalse(self._has_http_lock)
                    self._finished_list_called = True

        options, args = run_webkit_tests.parse_args(['--platform=test', '--print=nothing', 'http/tests/passes', 'passes'])
        host = MockHost()
        port = host.port_factory.get(port_name=options.platform, options=options)
        run_webkit_tests._set_up_derived_options(port, options)
        printer = printing.Printer(port, options, StringIO.StringIO(), StringIO.StringIO(), configure_logging=False)
        manager = LockCheckingManager(port, options, printer)
        manager.collect_tests(args)
        manager.parse_expectations()
        result_summary = manager.set_up_run()
        num_unexpected_results = manager.run(result_summary)
        manager.clean_up_run()
        printer.cleanup()
        tester.assertEquals(num_unexpected_results, 0)
Exemplo n.º 2
0
 def get_manager_with_tests(test_names):
     host = MockHost()
     port = host.port_factory.get()
     manager = Manager(port,
                       options=MockOptions(test_list=None, http=True),
                       printer=Mock())
     manager.collect_tests(test_names)
     return manager
Exemplo n.º 3
0
 def test_perf_locking(tester):
     options, args = run_webkit_tests.parse_args(['--platform=test', '--print=nothing', '--no-http', 'passes', 'perf/'])
     host = MockHost()
     port = host.port_factory.get(port_name=options.platform, options=options)
     run_webkit_tests._set_up_derived_options(port, options)
     printer = printing.Printer(port, options, StringIO.StringIO(), StringIO.StringIO())
     manager = LockCheckingManager(port, options, printer, tester, False)
     manager.collect_tests(args)
     manager.parse_expectations()
     num_unexpected_results = manager.run()
     printer.cleanup()
     tester.assertEquals(num_unexpected_results, 0)
Exemplo n.º 4
0
 def test_perf_locking(tester):
     options, args = run_webkit_tests.parse_args(['--platform=test', '--print=nothing', '--no-http', 'passes', 'perf/'])
     host = MockHost()
     port = host.port_factory.get(port_name=options.platform, options=options)
     run_webkit_tests._set_up_derived_options(port, options)
     printer = printing.Printer(port, options, StringIO.StringIO(), StringIO.StringIO())
     manager = LockCheckingManager(port, options, printer, tester, False)
     manager.collect_tests(args)
     manager.parse_expectations()
     num_unexpected_results = manager.run()
     printer.cleanup()
     tester.assertEquals(num_unexpected_results, 0)
Exemplo n.º 5
0
    def test_http_locking(tester):
        class LockCheckingManager(Manager):
            def __init__(self, port, options, printer):
                super(LockCheckingManager,
                      self).__init__(port, options, printer)
                self._finished_list_called = False

            def handle_finished_list(self, source, list_name, num_tests,
                                     elapsed_time):
                if not self._finished_list_called:
                    tester.assertEquals(list_name, 'locked_tests')
                    tester.assertTrue(self._remaining_locked_shards)
                    tester.assertTrue(self._has_http_lock)

                super(LockCheckingManager,
                      self).handle_finished_list(source, list_name, num_tests,
                                                 elapsed_time)

                if not self._finished_list_called:
                    tester.assertEquals(self._remaining_locked_shards, [])
                    tester.assertFalse(self._has_http_lock)
                    self._finished_list_called = True

        options, args = run_webkit_tests.parse_args([
            '--platform=test', '--print=nothing', 'http/tests/passes', 'passes'
        ])
        host = MockHost()
        port = host.port_factory.get(port_name=options.platform,
                                     options=options)
        run_webkit_tests._set_up_derived_options(port, options)
        printer = printing.Printer(port,
                                   options,
                                   StringIO.StringIO(),
                                   StringIO.StringIO(),
                                   configure_logging=False)
        manager = LockCheckingManager(port, options, printer)
        manager.collect_tests(args)
        manager.parse_expectations()
        result_summary = manager.set_up_run()
        num_unexpected_results = manager.run(result_summary)
        manager.clean_up_run()
        printer.cleanup()
        tester.assertEquals(num_unexpected_results, 0)
Exemplo n.º 6
0
 def get_manager_with_tests(test_names):
     host = MockHost()
     port = host.port_factory.get()
     manager = Manager(port, options=MockOptions(test_list=None, http=True), printer=Mock())
     manager.collect_tests(test_names)
     return manager