Skip to content
Open
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
13 changes: 10 additions & 3 deletions kernelci/runtime/lava.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,10 @@

def _get_job_failure_metadata(self):
"""Get failed lava job metadata fields such as error type and
error message"""
lava_yaml = self._data['results']['lava']
error message"""

Check warning on line 123 in kernelci/runtime/lava.py

View workflow job for this annotation

GitHub Actions / Lint

trailing whitespace

Check warning on line 123 in kernelci/runtime/lava.py

View workflow job for this annotation

GitHub Actions / Lint

Trailing whitespace
lava_yaml = self._data['results'].get('lava')
if not lava_yaml:
return None
lava = yaml.safe_load(lava_yaml)
stages = {stage['name']: stage for stage in lava}
job_meta = stages.get('job', {}).get('metadata')
Expand Down Expand Up @@ -250,6 +252,8 @@
job_node['data']['error_msg'] = job_meta.get('error_msg')
else:
print(f"Job failure metadata not found for node: {job_node['id']}")
job_node['data']['error_code'] = "Infrastructure"
job_node['data']['error_msg'] = "Unknown infrastructure error"

child_nodes = self._get_results_hierarchy(results)

Expand Down Expand Up @@ -280,7 +284,10 @@

def get_log_parser(self):
"""Get a LogParser object from the callback data"""
return LogParser(self._data['log'])
log = self._data.get('log')
if not log:
return None
return LogParser(log)

def to_file(self, filename):
"""Write the callback data to a JSON file"""
Expand Down Expand Up @@ -325,7 +332,7 @@
submitter = node.get('submitter')
if submitter and submitter != 'service:pipeline':
priority = priority + 1
if priority > self.config.priority_max:

Check warning on line 335 in kernelci/runtime/lava.py

View workflow job for this annotation

GitHub Actions / Lint

Consider using 'priority = min(priority, priority_max)' instead of unnecessary if block
priority = self.config.priority_max
return priority

Expand Down
Loading