From 2516f0400cf9ff78efd0d126135ef364c668509a Mon Sep 17 00:00:00 2001 From: Brendan Jackman Date: Mon, 23 Jan 2017 18:47:32 +0000 Subject: [PATCH 1/2] TestEnv: Fix check for rt-app calibration requirement, again - The 'wloads' field is no longer part of the TestEnv target_conf, so don't check it. - Instead of checking self.__tools, check self.__installed_tools. This means that we will detect the requirement for calibration when rt-app is installed via install_tools, as is done by the executor. Overall this accounts for the fact that `wloads` is now a configuration field for the Executor (experiments_conf) rather than the TestEnv (target_conf/test_conf). --- libs/utils/env.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/libs/utils/env.py b/libs/utils/env.py index f5bd768c3..c0fc24f71 100644 --- a/libs/utils/env.py +++ b/libs/utils/env.py @@ -681,14 +681,7 @@ class TestEnv(ShareState): if not force and self._calib: return self._calib - required = False - if force: - required = True - if 'rt-app' in self.__tools: - required = True - elif 'wloads' in self.conf: - wloads = self.conf['wloads'].values() - required = any(['rt-app' in wl['type'] for wl in wloads]) + required = force or 'rt-app' in self.__installed_tools if not required: self._log.debug('No RT-App workloads, skipping calibration') -- GitLab From fcc79aeed9fe267167266c16319626af45714c4f Mon Sep 17 00:00:00 2001 From: Brendan Jackman Date: Tue, 24 Jan 2017 10:48:22 +0000 Subject: [PATCH 2/2] TestEnv: Add docstring for calibration method --- libs/utils/env.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libs/utils/env.py b/libs/utils/env.py index c0fc24f71..02b7334ad 100644 --- a/libs/utils/env.py +++ b/libs/utils/env.py @@ -677,6 +677,15 @@ class TestEnv(ShareState): return (self.platform, plt_file) def calibration(self, force=False): + """ + Get rt-app calibration. Run calibration on target if necessary. + + :param force: Always run calibration on target, even if we have not + installed rt-app or have already run calibration. + :returns: A dict with calibration results, which can be passed as the + ``calibration`` parameter to :class:`RTA`, or ``None`` if + force=False and we have not installed rt-app. + """ if not force and self._calib: return self._calib -- GitLab