mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-09-03 03:42:35 +01:00
configuration: Add support for section groups
Now allows for specifying a `group` value for each section which will cross product the sections within that group with the sections in each other group. Additionally classifiers will automatically be added to each job spec with the relevant group information.
This commit is contained in:
@@ -69,14 +69,20 @@ class SectionNode(JobSpecSource):
|
||||
def is_leaf(self):
|
||||
return not bool(self.children)
|
||||
|
||||
def __init__(self, config, parent=None):
|
||||
def __init__(self, config, parent=None, group=None):
|
||||
super(SectionNode, self).__init__(config, parent=parent)
|
||||
self.workload_entries = []
|
||||
self.children = []
|
||||
self.group = group
|
||||
|
||||
def add_section(self, section):
|
||||
new_node = SectionNode(section, parent=self)
|
||||
self.children.append(new_node)
|
||||
def add_section(self, section, group=None):
|
||||
# Each level is the same group, only need to check first
|
||||
if not self.children or group == self.children[0].group:
|
||||
new_node = SectionNode(section, parent=self, group=group)
|
||||
self.children.append(new_node)
|
||||
else:
|
||||
for child in self.children:
|
||||
new_node = child.add_section(section, group)
|
||||
return new_node
|
||||
|
||||
def add_workload(self, workload_config):
|
||||
|
Reference in New Issue
Block a user