Title: [295525] trunk/Tools
Revision
295525
Author
clo...@igalia.com
Date
2022-06-14 10:07:46 -0700 (Tue, 14 Jun 2022)

Log Message

Port to Python3
https://bugs.webkit.org/show_bug.cgi?id=230098
<rdar://problem/82925374>

Reviewed by Aakash Jain.

Port browserperfdash-benchmark to python3 and invoke it with
the python3 interpreter on the CI.

* Tools/CISupport/build-webkit-org/steps.py:
(RunBenchmarkTests):
* Tools/Scripts/browserperfdash-benchmark:
* Tools/Scripts/webkitpy/browserperfdash/browserperfdash_runner.py:
(BrowserPerfDashRunner._parse_config_file):
(BrowserPerfDashRunner._upload_result):

Canonical link: https://commits.webkit.org/251530@main

Modified Paths

Diff

Modified: trunk/Tools/CISupport/build-webkit-org/steps.py (295524 => 295525)


--- trunk/Tools/CISupport/build-webkit-org/steps.py	2022-06-14 16:21:47 UTC (rev 295524)
+++ trunk/Tools/CISupport/build-webkit-org/steps.py	2022-06-14 17:07:46 UTC (rev 295525)
@@ -1128,7 +1128,7 @@
     name = "benchmark-test"
     description = ["benchmark tests running"]
     descriptionDone = ["benchmark tests"]
-    command = ["python", "Tools/Scripts/browserperfdash-benchmark", "--allplans",
+    command = ["python3", "Tools/Scripts/browserperfdash-benchmark", "--allplans",
                "--config-file", "../../browserperfdash-benchmark-config.txt",
                "--browser-version", WithProperties("%(archive_revision)s")]
 

Modified: trunk/Tools/Scripts/browserperfdash-benchmark (295524 => 295525)


--- trunk/Tools/Scripts/browserperfdash-benchmark	2022-06-14 16:21:47 UTC (rev 295524)
+++ trunk/Tools/Scripts/browserperfdash-benchmark	2022-06-14 17:07:46 UTC (rev 295525)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 #
 # Copyright (C) 2018 Igalia S.L.
 #

Modified: trunk/Tools/Scripts/webkitpy/browserperfdash/browserperfdash_runner.py (295524 => 295525)


--- trunk/Tools/Scripts/webkitpy/browserperfdash/browserperfdash_runner.py	2022-06-14 16:21:47 UTC (rev 295524)
+++ trunk/Tools/Scripts/webkitpy/browserperfdash/browserperfdash_runner.py	2022-06-14 17:07:46 UTC (rev 295525)
@@ -22,7 +22,7 @@
 
 
 import argparse
-import ConfigParser
+import configparser
 import json
 import logging
 import os
@@ -81,7 +81,7 @@
     def _parse_config_file(self, config_file):
         if not os.path.isfile(config_file):
             raise Exception('Can not open config file for uploading results at: {config_file}'.format(config_file=config_file))
-        self._config_parser = ConfigParser.RawConfigParser()
+        self._config_parser = configparser.RawConfigParser()
         self._config_parser.read(config_file)
 
     def _get_test_version_string(self, plan_name):
@@ -108,10 +108,10 @@
         for server in self._config_parser.sections():
             self._result_data['bot_id'] = self._config_parser.get(server, 'bot_id')
             self._result_data['bot_password'] = self._config_parser.get(server, 'bot_password')
-            post_data = urllib.urlencode(self._result_data)
+            post_data = urllib.parse.urlencode(self._result_data).encode('utf-8')
             post_url = self._config_parser.get(server, 'post_url')
             try:
-                post_request = urllib.urlopen(post_url, post_data)
+                post_request = urllib.request.urlopen(post_url, post_data)
                 if post_request.getcode() == 200:
                     _log.info('Sucesfully uploaded results to server {server_name} for test {test_name} and browser {browser_name} version {browser_version}'.format(
                                server_name=server, test_name=self._result_data['test_id'], browser_name=self._result_data['browser_id'], browser_version=self._result_data['browser_version']))
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to