mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-06-20 07:16:11 +01:00
WA3 Exsisting Code
This commit is contained in:
wa
__init__.py
commands
framework
__init__.pyactor.pyagenda.pycommand.py
configuration
entrypoint.pyexception.pyexecution.pyhost.pylog.pyoutput.pyplugin.pypluginloader.pyresource.pyrun.pysignal.pyversion.pyworkload.pytests
__init__.py
data
test_agenda.pytest_config.pytest_diff.pytest_execution.pytest_plugin.pytest_runner.pytest_signal.pytest_utils.pytestutils.pyutils
workloads
67
wa/framework/configuration/execution.py
Normal file
67
wa/framework/configuration/execution.py
Normal file
@ -0,0 +1,67 @@
|
||||
from copy import copy
|
||||
from collections import OrderedDict
|
||||
|
||||
from wa.framework import pluginloader
|
||||
from wa.framework.exception import ConfigError
|
||||
from wa.framework.configuration.core import ConfigurationPoint
|
||||
from wa.framework.utils.types import TreeNode, list_of, identifier
|
||||
|
||||
|
||||
class ExecConfig(object):
|
||||
|
||||
static_config_points = [
|
||||
ConfigurationPoint(
|
||||
'components',
|
||||
kind=list_of(identifier),
|
||||
description="""
|
||||
Components to be activated.
|
||||
""",
|
||||
),
|
||||
ConfigurationPoint(
|
||||
'runtime_parameters',
|
||||
kind=list_of(identifier),
|
||||
aliases=['runtime_params'],
|
||||
description="""
|
||||
Components to be activated.
|
||||
""",
|
||||
),
|
||||
ConfigurationPoint(
|
||||
'classifiers',
|
||||
kind=list_of(str),
|
||||
description="""
|
||||
Classifiers to be used. Classifiers are arbitrary key-value
|
||||
pairs associated with with config. They may be used during output
|
||||
proicessing and should be used to provide additional context for
|
||||
collected results.
|
||||
""",
|
||||
),
|
||||
]
|
||||
|
||||
config_points = None
|
||||
|
||||
@classmethod
|
||||
def _load(cls, load_global=False, loader=pluginloader):
|
||||
if cls.config_points is None:
|
||||
cls.config_points = {c.name: c for c in cls.static_config_points}
|
||||
for plugin in loader.list_plugins():
|
||||
cp = ConfigurationPoint(
|
||||
plugin.name,
|
||||
kind=OrderedDict,
|
||||
description="""
|
||||
Configuration for {} plugin.
|
||||
""".format(plugin.name)
|
||||
)
|
||||
cls._add_config_point(plugin.name, cp)
|
||||
for alias in plugin.aliases:
|
||||
cls._add_config_point(alias.name, cp)
|
||||
|
||||
@classmethod
|
||||
def _add_config_point(cls, name, cp):
|
||||
if name in cls.config_points:
|
||||
message = 'Cofig point for "{}" already exists ("{}")'
|
||||
raise ValueError(message.format(name, cls.config_points[name].name))
|
||||
|
||||
|
||||
|
||||
class GlobalExecConfig(ExecConfig):
|
||||
|
Reference in New Issue
Block a user