Changeset 268880 in webkit
- Timestamp:
- Oct 22, 2020, 11:51:09 AM (6 years ago)
- Location:
- trunk/Tools
- Files:
-
- 5 edited
-
BuildSlaveSupport/build.webkit.org-config/steps.py (modified) (1 diff)
-
ChangeLog (modified) (1 diff)
-
Scripts/webkitpy/performance_tests/perftestsrunner.py (modified) (3 diffs)
-
Scripts/webkitpy/performance_tests/perftestsrunner_integrationtest.py (modified) (3 diffs)
-
Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/BuildSlaveSupport/build.webkit.org-config/steps.py
r268768 r268880 938 938 command = ["python", "./Tools/Scripts/run-perf-tests", 939 939 "--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", 941 941 "--no-show-results", 942 942 "--reset-results", -
trunk/Tools/ChangeLog
r268879 r268880 1 2020-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 1 20 2020-10-22 Jonathan Bedard <jbedard@apple.com> 2 21 -
trunk/Tools/Scripts/webkitpy/performance_tests/perftestsrunner.py
r233651 r268880 112 112 optparse.make_option("--reset-results", action="store_true", 113 113 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."), 116 117 optparse.make_option("--description", 117 118 help="Add a description to the output JSON file if one is generated"), … … 247 248 output = self._generate_results_dict(self._timestamp, options.description, options.platform, options.builder_name, options.build_number) 248 249 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) 251 252 if not output: 252 253 return self.EXIT_CODE_BAD_SOURCE_JSON … … 317 318 return datetime.strftime('%Y-%m-%dT%H:%M:%S.%f') 318 319 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)) 322 323 return None 323 324 324 325 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] 329 330 return contents 330 331 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)) 332 333 return None 333 334 -
trunk/Tools/Scripts/webkitpy/performance_tests/perftestsrunner_integrationtest.py
r265883 r268880 447 447 self._test_run_with_json_output(runner, port.host.filesystem, expected_exit_code=PerfTestsRunner.EXIT_CODE_BAD_MERGE) 448 448 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"}') 453 453 self._test_run_with_json_output(runner, port.host.filesystem, upload_succeeds=True) 454 454 self.assertEqual(self._load_output_json(runner), [{ … … 456 456 "revisions": {"WebKit": {"timestamp": "2013-02-01 08:48:05 +0000", "revision": "5678"}}, "builderKey": "value"}]) 457 457 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']) 461 461 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') 464 464 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"]') 466 466 self._test_run_with_json_output(runner, port.host.filesystem, expected_exit_code=PerfTestsRunner.EXIT_CODE_BAD_SOURCE_JSON) 467 467 … … 491 491 runner, port = self.create_runner_and_setup_results_template(args=['--output-json-path=/mock-checkout/output.json', 492 492 '--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"}') 495 495 496 496 self._test_run_with_json_output(runner, port.host.filesystem, upload_succeeds=True) -
trunk/Tools/Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py
r265883 r268880 150 150 '--reset-results', 151 151 '--output-json-path=a/output.json', 152 '-- slave-config-json-path=a/source.json',152 '--worker-config-json-path=a/source.json', 153 153 '--test-results-server=somehost', 154 154 '--additional-drt-flag=--enable-threaded-parser', … … 168 168 self.assertTrue(options.reset_results) 169 169 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') 171 171 self.assertEqual(options.test_results_server, 'somehost') 172 172 self.assertEqual(options.additional_drt_flag, ['--enable-threaded-parser', '--awesomesauce']) … … 174 174 self.assertEqual(options.test_runner_count, 5) 175 175 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') 176 181 177 182 def test_upload_json(self):
Note:
See TracChangeset
for help on using the changeset viewer.