Skip to content

Commit abe76cd

Browse files
committed
config/runtime: Add support for parameter "platforms"
We might have limited set of platforms available in certain lab. Lab owners should have option to define such list. As per suggestion: kernelci/kernelci-project#350 (comment) Signed-off-by: Denys Fedoryshchenko <denys.f@collabora.com>
1 parent 19f65ab commit abe76cd

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

kernelci/config/runtime.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class RuntimeLAVA(Runtime):
8585
# pylint: disable=too-many-arguments
8686
def __init__(self, url, priority=None, priority_min=None,
8787
priority_max=None, queue_timeout=None, notify=None,
88-
**kwargs):
88+
platforms=None, **kwargs):
8989
super().__init__(**kwargs)
9090

9191
def _set_priority_value(value, default):
@@ -97,6 +97,10 @@ def _set_priority_value(value, default):
9797
self._priority_max = _set_priority_value(priority_max, self._priority)
9898
self._notify = notify or {}
9999
self._queue_timeout = queue_timeout
100+
# set platforms is list or None
101+
if platforms and not isinstance(platforms, list):
102+
raise ValueError('platforms must be a list')
103+
self._platforms = platforms
100104

101105
@property
102106
def url(self):
@@ -132,6 +136,11 @@ def notify(self):
132136
"""Callback parameters for the `notify` part of the jobs"""
133137
return self._notify.copy()
134138

139+
@property
140+
def platforms(self):
141+
"""List of platforms supported by the lab"""
142+
return self._platforms
143+
135144
@classmethod
136145
def _get_yaml_attributes(cls):
137146
attrs = super()._get_yaml_attributes()
@@ -142,6 +151,7 @@ def _get_yaml_attributes(cls):
142151
'queue_timeout',
143152
'url',
144153
'notify',
154+
'platforms',
145155
})
146156
return attrs
147157

tests/configs/runtimes.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ runtimes:
2525
queue_timeout:
2626
days: 1
2727
notify: {}
28+
platforms:
2829
filters:
2930
- blocklist:
3031
tree:
@@ -50,6 +51,7 @@ runtimes:
5051
callback:
5152
token: some-token-name
5253
url: https://somewhere.com:12345
54+
platforms:
5355
filters:
5456
- blocklist:
5557
tree: [android]

0 commit comments

Comments
 (0)