From 683831e33bab86dd1f8d6844f7fa2aec5e12b171 Mon Sep 17 00:00:00 2001 From: Yujun Zhang Date: Wed, 26 Jul 2017 14:30:28 +0800 Subject: Deprecate plan and metric loader - qtip test plan is now automaticlly generated by `qtip create`. The original way of loading plans is no longer valid - metric specs are now embedded in qpi spec, no separated loader are required now JIRA: QTIP-258 Change-Id: I768d75b014163ce060faff00f415a1cdc437ce73 Signed-off-by: Yujun Zhang --- qtip/loader/metric.py | 16 -------------- qtip/loader/plan.py | 58 --------------------------------------------------- qtip/loader/qpi.py | 3 --- 3 files changed, 77 deletions(-) delete mode 100644 qtip/loader/metric.py delete mode 100644 qtip/loader/plan.py (limited to 'qtip/loader') diff --git a/qtip/loader/metric.py b/qtip/loader/metric.py deleted file mode 100644 index 842fcdbf..00000000 --- a/qtip/loader/metric.py +++ /dev/null @@ -1,16 +0,0 @@ -############################################################################## -# Copyright (c) 2016 ZTE Corp and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## - -from yaml_file import YamlFileLoader - - -class MetricSpec(YamlFileLoader): - """metrics in QTIP are categorized by performance test tools, such as - dhrystone, whetstone and etc""" - RELATIVE_PATH = 'metric' diff --git a/qtip/loader/plan.py b/qtip/loader/plan.py deleted file mode 100644 index e15651a3..00000000 --- a/qtip/loader/plan.py +++ /dev/null @@ -1,58 +0,0 @@ -############################################################################## -# Copyright (c) 2016 ZTE Corp and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## - - -from qtip.base.constant import BaseProp -from qtip.collector import CollectorProp as CProp -from qtip.collector.logfile import LogfileCollector -from qtip.loader.yaml_file import YamlFileLoader -from qtip.loader.qpi import QPISpec - - -# TODO(yujunz) more elegant way to load module dynamically -def load_collector(type_name): - if type_name == LogfileCollector.TYPE: - return LogfileCollector - else: - raise Exception("Invalid collector type: {}".format(type_name)) - - -class Plan(YamlFileLoader): - """ - a benchmark plan is consist of configuration and a QPI list - """ - - RELATIVE_PATH = 'plan' - - def __init__(self, name, paths=None): - super(Plan, self).__init__(name, paths) - - _config = self.content[PlanProp.CONFIG] - - self.collectors = [load_collector(c[CProp.TYPE])(c, self) - for c in _config[PlanProp.COLLECTORS]] - - self.qpis = [QPISpec(qpi, paths=paths) - for qpi in self.content[PlanProp.QPIS]] - - -class PlanProp(BaseProp): - # plan - INFO = 'info' - - FACILITY = 'facility' - ENGINEER = 'engineer' - - CONFIG = 'config' - - DRIVER = 'driver' - COLLECTORS = 'collectors' - REPORTER = 'reporter' - - QPIS = 'QPIs' diff --git a/qtip/loader/qpi.py b/qtip/loader/qpi.py index 73da61e9..2a85766e 100644 --- a/qtip/loader/qpi.py +++ b/qtip/loader/qpi.py @@ -8,7 +8,6 @@ ############################################################################## from yaml_file import YamlFileLoader -from metric import MetricSpec from qtip.base.constant import SpecProp from qtip.util.formula import Formula @@ -34,5 +33,3 @@ class Section(object): self.name = content[SpecProp.NAME] self.weight = content[SpecProp.WEIGHT] self.formula = Formula(content[SpecProp.FORMULA]) - self.metrics = [MetricSpec(record, paths=paths) - for record in content[SpecProp.METRICS]] -- cgit 1.2.3-korg