update global config with manifest

This commit is contained in:
Yusef Napora 2020-06-22 10:46:45 -04:00
parent 6eae66728b
commit 202cdda358
3 changed files with 31 additions and 10 deletions

View File

@ -107,7 +107,7 @@ class Metadata(Base):
class Global(Base):
plan = param.String()
case = param.String()
case = param.Selector()
builder = param.String()
runner = param.String()
@ -117,6 +117,15 @@ class Global(Base):
build_config = param.Dict(default={}, allow_None=True)
run_config = param.Dict(default={}, allow_None=True)
def set_manifest(self, manifest):
if manifest is None:
return
print('manifest:', manifest)
self.plan = manifest['name']
cases = [tc['name'] for tc in manifest['testcases']]
self.param['case'].objects = cases
print('global config updated manifest. cases:', self.param['case'].objects)
class Resources(Base):
memory = param.String(allow_None=True)
@ -173,8 +182,8 @@ class Group(Base):
class Composition(param.Parameterized):
metadata = param.Parameter(Metadata, precedence=-1)
global_config = param.Parameter(Global, precedence=-1)
metadata = param.Parameter(Metadata(), precedence=-1)
global_config = param.Parameter(Global(), precedence=-1)
groups = param.ObjectSelector()
groups_ui = None
@ -239,6 +248,9 @@ class Composition(param.Parameterized):
if manifest is None:
return
g = self.global_config
print('global conifg: ', g)
g.set_manifest(manifest)
for tc in manifest.get('testcases', []):
self.testcase_param_classes[tc['name']] = make_group_params_class(tc)

File diff suppressed because one or more lines are too long

View File

@ -80,8 +80,7 @@ cleanup () {
trap "{ cleanup; }" EXIT
# make sure we have the commands we need
require_cmds jq dockerimport param
import panel as pn
require_cmds jq docker
# make temp dir for manifests
temp_base="/tmp"