Skip to content
Merged
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
20 changes: 13 additions & 7 deletions lib/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ def report_atex(status, name=None, note=None, logs=None, *, partial=False):
# for subresults
if name:
result['name'] = name
# not standard ATEX, Contest-specific
if note:
result['note'] = note
# always set note, even for None
# (None -> JSON null -> clears add_log() set note)
result['note'] = note
# output of the test itself
if not name:
result['testout'] = 'output.txt'
Expand Down Expand Up @@ -256,10 +256,16 @@ def add_log(*logs):
or by passing multiple arguments.
"""
if have_atex_api():
# partial results are overwritten by the final result so we report an error partial result
# with logs in case test crashes or fails with an exception, see
# https://github.com/RHSecurityCompliance/atex/blob/main/atex/executor/RESULTS.md#partial-results
report_atex(status='error', logs=logs, partial=True)
# partial results are overwritten by the final result so we report
# an error partial result with logs in case test crashes or fails
# with an exception, see
# https://github.com/RHSecurityCompliance/atex/blob/main/atex/executor/fmf/RESULTS.md#partial-results
report_atex(
status='error',
logs=logs,
note="no final result provided",
partial=True,
)
elif have_tmt_api():
for log in logs:
_tmt_file_submit(log)
Expand Down
Loading