diff --git a/testing/talos/talos/ttest.py b/testing/talos/talos/ttest.py index 540bca937c47..0ed5a2bbd224 100644 --- a/testing/talos/talos/ttest.py +++ b/testing/talos/talos/ttest.py @@ -25,7 +25,7 @@ import mozfile from mozlog import get_proxy_logger -from talos.utils import TalosCrash, TalosRegression +from talos.utils import TalosCrash, TalosError, TalosRegression from talos.talos_process import run_browser from talos.ffsetup import FFSetup from talos.cmanager import CounterManagement @@ -34,8 +34,6 @@ LOG = get_proxy_logger() class TTest(object): - platform_type = utils.PLATFORM_TYPE - def check_for_crashes(self, browser_config, minidump_dir, test_name): # check for minidumps found = mozcrash.check_for_crashes(minidump_dir, @@ -59,14 +57,32 @@ class TTest(object): """ - LOG.debug("operating with platform_type : %s" % self.platform_type) - with FFSetup(browser_config, test_config) as setup: return self._runTest(browser_config, test_config, setup) + @staticmethod + def _get_counter_prefix(): + if platform.system() == "Linux": + return 'linux' + elif platform.system() in ("Windows", "Microsoft"): + if '6.1' in platform.version(): # w7 + return 'w7' + elif '6.2' in platform.version(): # w8 + return 'w8' + # Bug 1264325 - FIXME: with python 2.7.11: reports win8 instead of 8.1 + elif '6.3' in platform.version(): + return 'w8' + # Bug 1264325 - FIXME: with python 2.7.11: reports win8 instead of 10 + elif '10.0' in platform.version(): + return 'w8' + else: + raise TalosError('unsupported windows version') + elif platform.system() == "Darwin": + return 'mac' + def _runTest(self, browser_config, test_config, setup): minidump_dir = os.path.join(setup.profile_dir, 'minidumps') - counters = test_config.get(self.platform_type + 'counters', []) + counters = test_config.get('%s_counters' % self._get_counter_prefix(), []) resolution = test_config['resolution'] # add the mainthread_io to the environment variable, as defined diff --git a/testing/talos/talos/utils.py b/testing/talos/talos/utils.py index f73639a08653..329674c06c5f 100755 --- a/testing/talos/talos/utils.py +++ b/testing/talos/talos/utils.py @@ -20,32 +20,6 @@ here = os.path.dirname(os.path.realpath(__file__)) LOG = get_proxy_logger() -def _get_platform(): - # get the platform we're interested in. Note that the values - # are used in TTest historically, this is why they are not really friendly. - # TODO: give some user friendly values - if platform.system() == "Linux": - return 'linux_' - elif platform.system() in ("Windows", "Microsoft"): - if '6.1' in platform.version(): # w7 - return 'w7_' - elif '6.2' in platform.version(): # w8 - return 'w8_' - # Bug 1264325 - FIXME: with python 2.7.11: reports win8 instead of 8.1 - elif '6.3' in platform.version(): - return 'w8_' - # Bug 1264325 - FIXME: with python 2.7.11: reports win8 instead of 10 - elif '10.0' in platform.version(): - return 'w8_' - else: - raise TalosError('unsupported windows version') - elif platform.system() == "Darwin": - return 'mac_' - - -PLATFORM_TYPE = _get_platform() - - class Timer(object): def __init__(self): self._start_time = 0