⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 268880 in webkit


Ignore:
Timestamp:
Oct 22, 2020, 11:51:09 AM (6 years ago)
Author:
aakash_jain@apple.com
Message:

[webkitpy] Rename slave to worker in perftestsrunner
https://bugs.webkit.org/show_bug.cgi?id=218082

Reviewed by Ryosuke Niwa.

  • Scripts/webkitpy/performance_tests/perftestsrunner.py:

(PerfTestsRunner._parse_args): Supporting both --slave-config-json-path and --worker-config-json-path for now.
(_generate_results):
(_merge_worker_config_json):
(_merge_slave_config_json): Deleted.

  • Scripts/webkitpy/performance_tests/perftestsrunner_integrationtest.py:
  • Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py:

(MainTest.test_parse_args):
(MainTest.test_parse_deprecated_args): Added unit-test for deprecated parameter.

  • BuildSlaveSupport/build.webkit.org-config/steps.py:

(RunAndUploadPerfTests):

Location:
trunk/Tools
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/BuildSlaveSupport/build.webkit.org-config/steps.py

    r268768 r268880  
    938938    command = ["python", "./Tools/Scripts/run-perf-tests",
    939939               "--output-json-path", "perf-test-results.json",
    940                "--slave-config-json-path", "../../perf-test-config.json",
     940               "--worker-config-json-path", "../../perf-test-config.json",
    941941               "--no-show-results",
    942942               "--reset-results",
  • trunk/Tools/ChangeLog

    r268879 r268880  
     12020-10-22  Aakash Jain  <aakash_jain@apple.com>
     2
     3        [webkitpy] Rename slave to worker in perftestsrunner
     4        https://bugs.webkit.org/show_bug.cgi?id=218082
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        * Scripts/webkitpy/performance_tests/perftestsrunner.py:
     9        (PerfTestsRunner._parse_args): Supporting both --slave-config-json-path and --worker-config-json-path for now.
     10        (_generate_results):
     11        (_merge_worker_config_json):
     12        (_merge_slave_config_json): Deleted.
     13        * Scripts/webkitpy/performance_tests/perftestsrunner_integrationtest.py:
     14        * Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py:
     15        (MainTest.test_parse_args):
     16        (MainTest.test_parse_deprecated_args): Added unit-test for deprecated parameter.
     17        * BuildSlaveSupport/build.webkit.org-config/steps.py:
     18        (RunAndUploadPerfTests):
     19
    1202020-10-22  Jonathan Bedard  <jbedard@apple.com>
    221
  • trunk/Tools/Scripts/webkitpy/performance_tests/perftestsrunner.py

    r233651 r268880  
    112112            optparse.make_option("--reset-results", action="store_true",
    113113                help="Clears the content in the generated JSON file before adding the results."),
    114             optparse.make_option("--slave-config-json-path", action='callback', callback=_expand_path, type="str",
    115                 help="Only used on bots. Path to a slave configuration file."),
     114            optparse.make_option("--slave-config-json-path", "--worker-config-json-path", action='callback',
     115                callback=_expand_path, type="str", dest="worker_config_json_path",
     116                help="Only used on bots. Path to a worker configuration file."),
    116117            optparse.make_option("--description",
    117118                help="Add a description to the output JSON file if one is generated"),
     
    247248        output = self._generate_results_dict(self._timestamp, options.description, options.platform, options.builder_name, options.build_number)
    248249
    249         if options.slave_config_json_path:
    250             output = self._merge_slave_config_json(options.slave_config_json_path, output)
     250        if options.worker_config_json_path:
     251            output = self._merge_worker_config_json(options.worker_config_json_path, output)
    251252            if not output:
    252253                return self.EXIT_CODE_BAD_SOURCE_JSON
     
    317318        return datetime.strftime('%Y-%m-%dT%H:%M:%S.%f')
    318319
    319     def _merge_slave_config_json(self, slave_config_json_path, contents):
    320         if not self._host.filesystem.isfile(slave_config_json_path):
    321             _log.error("Missing slave configuration JSON file: %s" % slave_config_json_path)
     320    def _merge_worker_config_json(self, worker_config_json_path, contents):
     321        if not self._host.filesystem.isfile(worker_config_json_path):
     322            _log.error('Missing worker configuration JSON file: {}'.format(worker_config_json_path))
    322323            return None
    323324
    324325        try:
    325             slave_config_json = self._host.filesystem.open_text_file_for_reading(slave_config_json_path)
    326             slave_config = json.load(slave_config_json)
    327             for key in slave_config:
    328                 contents['builder' + key.capitalize()] = slave_config[key]
     326            worker_config_json = self._host.filesystem.open_text_file_for_reading(worker_config_json_path)
     327            worker_config = json.load(worker_config_json)
     328            for key in worker_config:
     329                contents['builder' + key.capitalize()] = worker_config[key]
    329330            return contents
    330331        except Exception as error:
    331             _log.error("Failed to merge slave configuration JSON file %s: %s" % (slave_config_json_path, error))
     332            _log.error('Failed to merge worker configuration JSON file {}: {}'.format(worker_config_json_path, error))
    332333        return None
    333334
  • trunk/Tools/Scripts/webkitpy/performance_tests/perftestsrunner_integrationtest.py

    r265883 r268880  
    447447        self._test_run_with_json_output(runner, port.host.filesystem, expected_exit_code=PerfTestsRunner.EXIT_CODE_BAD_MERGE)
    448448
    449     def test_run_with_slave_config_json(self):
    450         runner, port = self.create_runner_and_setup_results_template(args=['--output-json-path=/mock-checkout/output.json',
    451             '--slave-config-json-path=/mock-checkout/slave-config.json', '--test-results-server=some.host'])
    452         port.host.filesystem.write_text_file('/mock-checkout/slave-config.json', '{"key": "value"}')
     449    def test_run_with_worker_config_json(self):
     450        runner, port = self.create_runner_and_setup_results_template(args=['--output-json-path=/mock-checkout/output.json',
     451            '--worker-config-json-path=/mock-checkout/worker-config.json', '--test-results-server=some.host'])
     452        port.host.filesystem.write_text_file('/mock-checkout/worker-config.json', '{"key": "value"}')
    453453        self._test_run_with_json_output(runner, port.host.filesystem, upload_succeeds=True)
    454454        self.assertEqual(self._load_output_json(runner), [{
     
    456456            "revisions": {"WebKit": {"timestamp": "2013-02-01 08:48:05 +0000", "revision": "5678"}}, "builderKey": "value"}])
    457457
    458     def test_run_with_bad_slave_config_json(self):
    459         runner, port = self.create_runner_and_setup_results_template(args=['--output-json-path=/mock-checkout/output.json',
    460             '--slave-config-json-path=/mock-checkout/slave-config.json', '--test-results-server=some.host'])
     458    def test_run_with_bad_worker_config_json(self):
     459        runner, port = self.create_runner_and_setup_results_template(args=['--output-json-path=/mock-checkout/output.json',
     460            '--worker-config-json-path=/mock-checkout/worker-config.json', '--test-results-server=some.host'])
    461461        logs = self._test_run_with_json_output(runner, port.host.filesystem, expected_exit_code=PerfTestsRunner.EXIT_CODE_BAD_SOURCE_JSON)
    462         self.assertTrue('Missing slave configuration JSON file: /mock-checkout/slave-config.json' in logs)
    463         port.host.filesystem.write_text_file('/mock-checkout/slave-config.json', 'bad json')
     462        self.assertTrue('Missing worker configuration JSON file: /mock-checkout/worker-config.json' in logs)
     463        port.host.filesystem.write_text_file('/mock-checkout/worker-config.json', 'bad json')
    464464        self._test_run_with_json_output(runner, port.host.filesystem, expected_exit_code=PerfTestsRunner.EXIT_CODE_BAD_SOURCE_JSON)
    465         port.host.filesystem.write_text_file('/mock-checkout/slave-config.json', '["another bad json"]')
     465        port.host.filesystem.write_text_file('/mock-checkout/worker-config.json', '["another bad json"]')
    466466        self._test_run_with_json_output(runner, port.host.filesystem, expected_exit_code=PerfTestsRunner.EXIT_CODE_BAD_SOURCE_JSON)
    467467
     
    491491        runner, port = self.create_runner_and_setup_results_template(args=['--output-json-path=/mock-checkout/output.json',
    492492            '--test-results-server', 'some.host', '--platform', 'platform1', '--builder-name', 'builder1', '--build-number', '123',
    493             '--slave-config-json-path=/mock-checkout/slave-config.json'])
    494         port.host.filesystem.write_text_file('/mock-checkout/slave-config.json', '{"key": "value1"}')
     493            '--worker-config-json-path=/mock-checkout/worker-config.json'])
     494        port.host.filesystem.write_text_file('/mock-checkout/worker-config.json', '{"key": "value1"}')
    495495
    496496        self._test_run_with_json_output(runner, port.host.filesystem, upload_succeeds=True)
  • trunk/Tools/Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py

    r265883 r268880  
    150150                '--reset-results',
    151151                '--output-json-path=a/output.json',
    152                 '--slave-config-json-path=a/source.json',
     152                '--worker-config-json-path=a/source.json',
    153153                '--test-results-server=somehost',
    154154                '--additional-drt-flag=--enable-threaded-parser',
     
    168168        self.assertTrue(options.reset_results)
    169169        self.assertEqual(options.output_json_path, 'a/output.json')
    170         self.assertEqual(options.slave_config_json_path, 'a/source.json')
     170        self.assertEqual(options.worker_config_json_path, 'a/source.json')
    171171        self.assertEqual(options.test_results_server, 'somehost')
    172172        self.assertEqual(options.additional_drt_flag, ['--enable-threaded-parser', '--awesomesauce'])
     
    174174        self.assertEqual(options.test_runner_count, 5)
    175175        self.assertEqual(options.no_timeout, True)
     176
     177    def test_parse_deprecated_args(self):
     178        # FIXME: remove this test and the corresponding parameter after all instances of this deprecated parameter have been removed
     179        options, _ = PerfTestsRunner._parse_args(['--slave-config-json-path=a/source1.json'])
     180        self.assertEqual(options.worker_config_json_path, 'a/source1.json')
    176181
    177182    def test_upload_json(self):
Note: See TracChangeset for help on using the changeset viewer.