Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config/runtime: Add support for parameter "platforms" #2545

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion kernelci/config/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class RuntimeLAVA(Runtime):
# pylint: disable=too-many-arguments
def __init__(self, url, priority=None, priority_min=None,
priority_max=None, queue_timeout=None, notify=None,
**kwargs):
platforms=None, **kwargs):
super().__init__(**kwargs)

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

@property
def url(self):
Expand Down Expand Up @@ -132,6 +136,11 @@ def notify(self):
"""Callback parameters for the `notify` part of the jobs"""
return self._notify.copy()

@property
def platforms(self):
"""List of platforms supported by the lab"""
return self._platforms

@classmethod
def _get_yaml_attributes(cls):
attrs = super()._get_yaml_attributes()
Expand All @@ -142,6 +151,7 @@ def _get_yaml_attributes(cls):
'queue_timeout',
'url',
'notify',
'platforms',
})
return attrs

Expand Down
2 changes: 2 additions & 0 deletions tests/configs/runtimes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ runtimes:
queue_timeout:
days: 1
notify: {}
platforms:
filters:
- blocklist:
tree:
Expand All @@ -50,6 +51,7 @@ runtimes:
callback:
token: some-token-name
url: https://somewhere.com:12345
platforms:
filters:
- blocklist:
tree: [android]
Expand Down
Loading