Changeset 250784 in webkit
- Timestamp:
- Oct 7, 2019 1:07:33 PM (5 years ago)
- Location:
- trunk/Tools
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/BuildSlaveSupport/build.webkit.org-config/loadConfig.py
r250746 r250784 50 50 else: 51 51 passwords = json.load(open('passwords.json')) 52 results_server_api_key = passwords.get('results-server-api-key') 53 if results_server_api_key: 54 os.environ['RESULTS_SERVER_API_KEY'] = results_server_api_key 55 52 56 config = json.load(open('config.json')) 53 54 57 c['slaves'] = [BuildSlave(slave['name'], passwords[slave['name']], max_builds=1) for slave in config['slaves']] 55 58 -
trunk/Tools/BuildSlaveSupport/build.webkit.org-config/make_passwords_json.py
r175798 r250784 32 32 with open('config.json', 'r') as config_json: 33 33 config_dict = json.load(config_json) 34 return dict([(slave['name'], '1234') for slave in config_dict['slaves']]) 34 result = dict([(slave['name'], '1234') for slave in config_dict['slaves']]) 35 result['results-server-api-key'] = 'api-key' 36 return result 35 37 36 38 if __name__ == '__main__': -
trunk/Tools/BuildSlaveSupport/build.webkit.org-config/steps.py
r250746 r250784 36 36 S3URL = "https://s3-us-west-2.amazonaws.com/" 37 37 WithProperties = properties.WithProperties 38 RESULTS_WEBKIT = 'https://results.webkit.org' 39 RESULTS_SERVER_API_KEY = 'RESULTS_SERVER_API_KEY' 38 40 39 41 … … 417 419 "--builder-name", WithProperties("%(buildername)s"), 418 420 "--build-number", WithProperties("%(buildnumber)s"), 421 "--buildbot-worker", WithProperties("%(slavename)s"), 419 422 "--master-name", "webkit.org", 423 "--buildbot-master", "build.webkit.org", 424 "--report", RESULTS_WEBKIT, 420 425 "--test-results-server", "webkit-test-results.webkit.org", 421 426 "--exit-after-n-crashes-or-timeouts", "50", … … 423 428 WithProperties("--%(configuration)s")] 424 429 425 def start(self): 430 def __init__(self, *args, **kwargs): 431 kwargs['logEnviron'] = False 432 shell.Test.__init__(self, *args, **kwargs) 433 434 def start(self): 435 self.slaveEnvironment[RESULTS_SERVER_API_KEY] = os.getenv(RESULTS_SERVER_API_KEY) 436 426 437 platform = self.getProperty('platform') 427 438 appendCustomTestingFlags(self, platform, self.getProperty('device_model')) … … 531 542 description = ["api tests running"] 532 543 descriptionDone = ["api-tests"] 533 command = ["python", "./Tools/Scripts/run-api-tests", "--no-build", WithProperties("--%(configuration)s"), "--verbose"] 544 command = [ 545 "python", 546 "./Tools/Scripts/run-api-tests", 547 "--no-build", 548 WithProperties("--%(configuration)s"), 549 "--verbose", 550 "--buildbot-master", "build.webkit.org", 551 "--builder-name", WithProperties("%(buildername)s"), 552 "--build-number", WithProperties("%(buildnumber)s"), 553 "--buildbot-worker", WithProperties("%(slavename)s"), 554 "--report", RESULTS_WEBKIT, 555 ] 534 556 failedTestsFormatString = "%d api test%s failed or timed out" 535 557 536 def start(self): 558 def __init__(self, *args, **kwargs): 559 kwargs['logEnviron'] = False 560 TestWithFailureCount.__init__(self, *args, **kwargs) 561 562 def start(self): 563 self.slaveEnvironment[RESULTS_SERVER_API_KEY] = os.getenv(RESULTS_SERVER_API_KEY) 537 564 appendCustomTestingFlags(self, self.getProperty('platform'), self.getProperty('device_model')) 538 565 return shell.Test.start(self) … … 551 578 description = ["python-tests running"] 552 579 descriptionDone = ["python-tests"] 553 command = ["python", "./Tools/Scripts/test-webkitpy", "--verbose", WithProperties("--%(configuration)s")] 580 command = [ 581 "python", 582 "./Tools/Scripts/test-webkitpy", 583 "--verbose", 584 WithProperties("--%(configuration)s"), 585 "--buildbot-master", "build.webkit.org", 586 "--builder-name", WithProperties("%(buildername)s"), 587 "--build-number", WithProperties("%(buildnumber)s"), 588 "--buildbot-worker", WithProperties("%(slavename)s"), 589 "--report", RESULTS_WEBKIT, 590 ] 554 591 failedTestsFormatString = "%d python test%s failed" 555 592 556 def start(self): 593 def __init__(self, *args, **kwargs): 594 kwargs['logEnviron'] = False 595 TestWithFailureCount.__init__(self, *args, **kwargs) 596 597 def start(self): 598 self.slaveEnvironment[RESULTS_SERVER_API_KEY] = os.getenv(RESULTS_SERVER_API_KEY) 599 557 600 platform = self.getProperty('platform') 558 601 # Python tests are flaky on the GTK builders, running them serially -
trunk/Tools/ChangeLog
r250775 r250784 1 2019-10-07 Jonathan Bedard <jbedard@apple.com> 2 3 results.webkit.org: Start reporting results 4 https://bugs.webkit.org/show_bug.cgi?id=202639 5 6 Reviewed by Dewei Zhu. 7 8 * BuildSlaveSupport/build.webkit.org-config/loadConfig.py: 9 (loadBuilderConfig): Load API key for results.webkit.org. 10 * BuildSlaveSupport/build.webkit.org-config/make_passwords_json.py: 11 (create_mock_slave_passwords_dict): Add mock for API key. 12 * BuildSlaveSupport/build.webkit.org-config/steps.py: 13 (RunWebKitTests): Start reporting to results.webkit.org. 14 (RunWebKitTests.__init__): Do not print the environment to hide the API key. 15 (RunWebKitTests.start): Add the API key to the environment. 16 (RunAPITests): Start reporting to results.webkit.org. 17 (RunAPITests.__init__): Do not print the environment to hide the API key. 18 (RunAPITests.start): Add the API key to the environment. 19 (RunPythonTests): Start reporting to results.webkit.org. 20 (RunPythonTests.__init__): Do not print the environment to hide the API key. 21 (RunPythonTests.start): Add the API key to the environment. 22 * Scripts/webkitpy/results/upload.py: 23 (Upload): 24 (Upload.upload): Add API_KEY, if it exists, to the request. 25 (Upload.upload_archive): Ditto. 26 1 27 2019-10-07 Matt Lewis <jlewis3@apple.com> 2 28 -
trunk/Tools/Scripts/webkitpy/results/upload.py
r249652 r250784 23 23 import webkitpy.thirdparty.autoinstalled.requests 24 24 25 import os 25 26 import json 26 27 import requests … … 32 33 33 34 class Upload(object): 35 API_KEY = os.getenv('RESULTS_SERVER_API_KEY') 34 36 UPLOAD_ENDPOINT = '/api/upload' 35 37 ARCHIVE_UPLOAD_ENDPOINT = '/api/upload/archive' … … 170 172 def upload(self, hostname, log_line_func=lambda val: sys.stdout.write(val + '\n')): 171 173 try: 172 response = requests.post('{}{}'.format(hostname, self.UPLOAD_ENDPOINT), data=json.dumps(self, cls=Upload.Encoder)) 174 data = Upload.Encoder().default(self) 175 if self.API_KEY: 176 data['api_key'] = self.API_KEY 177 response = requests.post('{}{}'.format(hostname, self.UPLOAD_ENDPOINT), data=json.dumps(data)) 173 178 except requests.exceptions.ConnectionError: 174 179 log_line_func(' ' * 4 + 'Failed to upload to {}, results server not online'.format(hostname)) … … 196 201 if self.timestamp: 197 202 meta_data['timestamp'] = self.timestamp 203 if self.API_KEY: 204 meta_data['api_key'] = self.API_KEY 198 205 response = requests.post( 199 206 '{}{}'.format(hostname, self.ARCHIVE_UPLOAD_ENDPOINT),
Note: See TracChangeset
for help on using the changeset viewer.