Changeset 165413 in webkit


Ignore:
Timestamp:
Mar 10, 2014 4:22:05 PM (10 years ago)
Author:
zoltan@webkit.org
Message:

Let the user define the full address of the performance-site-server for uploading results
https://bugs.webkit.org/show_bug.cgi?id=129819

Reviewed by Ryosuke Niwa.

Currently perftestsrunner.py assumes that the server uses https protocol all the time, which
can be confusing. It's more straightforward, if you need to define explicitly the server's full
address along with the protocol, when you're using this parameter. I added HTTPS as the default
protocol for now, in order to avoid breaking the perf bots.

  • Scripts/webkitpy/performance_tests/perftestsrunner.py:

(_upload_json):

  • Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py:

(MainTest.test_upload_json):

Location:
trunk/Tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r165393 r165413  
     12014-03-10  Zoltan Horvath  <zoltan@webkit.org>
     2
     3        Let the user define the full address of the performance-site-server for uploading results
     4        https://bugs.webkit.org/show_bug.cgi?id=129819
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Currently perftestsrunner.py assumes that the server uses https protocol all the time, which
     9        can be confusing. It's more straightforward, if you need to define explicitly the server's full
     10        address along with the protocol, when you're using this parameter. I added HTTPS as the default
     11        protocol for now, in order to avoid breaking the perf bots.
     12
     13        * Scripts/webkitpy/performance_tests/perftestsrunner.py:
     14        (_upload_json):
     15        * Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py:
     16        (MainTest.test_upload_json):
     17
    1182014-03-10  Brent Fulgham  <bfulgham@apple.com>
    219
  • trunk/Tools/Scripts/webkitpy/performance_tests/perftestsrunner.py

    r162183 r165413  
    310310
    311311    def _upload_json(self, test_results_server, json_path, host_path="/api/report", file_uploader=FileUploader):
    312         url = "https://%s%s" % (test_results_server, host_path)
     312        hypertext_protocol = ''
     313        if not test_results_server.startswith('http'):
     314            hypertext_protocol = 'https://'
     315        url = hypertext_protocol + test_results_server + host_path
    313316        uploader = file_uploader(url, 120)
    314317        try:
  • trunk/Tools/Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py

    r159803 r165413  
    187187
    188188        MockFileUploader.upload_single_text_file_return_value = StringIO.StringIO('OK')
     189        self.assertTrue(runner._upload_json('https://some.host', 'some.json', '/some/path', MockFileUploader))
     190        self.assertEqual(MockFileUploader.called, ['FileUploader', 'upload_single_text_file'])
     191
     192        MockFileUploader.reset()
     193        MockFileUploader.upload_single_text_file_return_value = StringIO.StringIO('OK')
    189194        self.assertTrue(runner._upload_json('some.host', 'some.json', '/some/path', MockFileUploader))
    190         self.assertEqual(MockFileUploader.called, ['FileUploader', 'upload_single_text_file'])
    191195
    192196        MockFileUploader.reset()
     
    194198        output = OutputCapture()
    195199        output.capture_output()
    196         self.assertFalse(runner._upload_json('some.host', 'some.json', '/some/path', MockFileUploader))
     200        self.assertFalse(runner._upload_json('https://some.host', 'some.json', '/some/path', MockFileUploader))
    197201        _, _, logs = output.restore_output()
    198202        self.assertEqual(logs, 'Uploaded JSON to https://some.host/some/path but got a bad response:\nSome error\n')
     
    201205        MockFileUploader.reset()
    202206        MockFileUploader.upload_single_text_file_throws = True
    203         self.assertFalse(runner._upload_json('some.host', 'some.json', '/some/path', MockFileUploader))
     207        self.assertFalse(runner._upload_json('https://some.host', 'some.json', '/some/path', MockFileUploader))
    204208        self.assertEqual(MockFileUploader.called, ['FileUploader', 'upload_single_text_file'])
    205209
    206210        MockFileUploader.reset()
    207211        MockFileUploader.upload_single_text_file_return_value = StringIO.StringIO('{"status": "OK"}')
    208         self.assertTrue(runner._upload_json('some.host', 'some.json', '/some/path', MockFileUploader))
     212        self.assertTrue(runner._upload_json('https://some.host', 'some.json', '/some/path', MockFileUploader))
    209213        self.assertEqual(MockFileUploader.called, ['FileUploader', 'upload_single_text_file'])
    210214
     
    213217        output = OutputCapture()
    214218        output.capture_output()
    215         self.assertFalse(runner._upload_json('some.host', 'some.json', '/some/path', MockFileUploader))
     219        self.assertFalse(runner._upload_json('https://some.host', 'some.json', '/some/path', MockFileUploader))
    216220        _, _, logs = output.restore_output()
    217221        serialized_json = json.dumps({'status': 'SomethingHasFailed', 'failureStored': False}, indent=4)
Note: See TracChangeset for help on using the changeset viewer.