def test_worker_no_manifest_update(self):
     # pylint: disable=protected-access
     options = run_web_tests.parse_args(['--platform',
                                         'test-mac-mac10.11'])[0]
     worker = Worker(self.DummyCaller(), '/results', options)
     self.assertTrue(options.manifest_update)
     self.assertFalse(worker._options.manifest_update)
    def _runner(self, port=None):
        # FIXME: we shouldn't have to use run_web_tests.py to get the options we need.
        options = run_web_tests.parse_args(['--platform',
                                            'test-mac-mac10.11'])[0]
        options.child_processes = '1'

        host = MockHost()
        port = port or host.port_factory.get(options.platform, options=options)
        return LockCheckingRunner(port, options, FakePrinter(), self, True)
Example #3
0
def main(args, stderr):
    parser = argparse.ArgumentParser(
        description=
        'Start the WebGPU expectations server, then forwards to run_web_tests.py'
    )
    parser.add_argument('--webgpu-cts-expectations', required=True)

    options, rest_args = parser.parse_known_args(args)

    web_test_expectations_fd, web_test_expectations_file = mkstemp()

    forwarded_args = rest_args + [
        '--ignore-default-expectations', '--additional-expectations',
        web_test_expectations_file
    ]

    run_web_tests_options = run_web_tests.parse_args(forwarded_args)[0]

    # Construct a web tests port using the test arguments forwarded to run_web_tests.py
    # (ex. --platform=android) in order to discover the tags that the web tests harness will
    # use. This includes the OS, OS version, architecture, etc.
    platform_tags = Host().port_factory.get(
        run_web_tests_options.platform,
        run_web_tests_options).get_platform_tags()

    with open(options.webgpu_cts_expectations) as f:
        split_result = split_cts_expectations_and_web_test_expectations(
            f.read(), platform_tags)

    # Write the out expectation file for web tests.
    with open(web_test_expectations_file, 'w') as expectations_out:
        web_test_exp = split_result['web_test_expectations']
        expectations_out.write('# tags: [ ' +
                               ' '.join(web_test_exp['tag_set']) + ' ]\n')
        expectations_out.write('# results: [ Slow ' +
                               ' '.join(web_test_exp['result_set']) + ' ]\n\n')
        for exp in web_test_exp['expectations']:
            expectations_out.write(exp.to_string() + '\n')

    server = ExpectationsServer(split_result['cts_expectations_js'],
                                ('127.0.0.1', 3000))

    print('Starting expectations server...')
    server.start()

    try:
        run_web_tests.main(forwarded_args, stderr)

    finally:
        print('Stopping expectations server...')
        server.stop()
        os.close(web_test_expectations_fd)